code: def test_path_strict_resolve(tmpdir):
      """Check the monkeypatch to test strict resolution of Path."""
      tmpdir.chdir()
  
      # Default strict=False should work out of the box
      testfile = Path("somefile.txt")
      resolved = "%s/somefile.txt" % tmpdir
      assert str(path_resolve(testfile)) == resolved
      # Strict keyword is always allowed
      assert str(path_resolve(testfile, strict=False)) == resolved
  
      # Switching to strict=True must raise FileNotFoundError (also in Python2)
      with pytest.raises(FileNotFoundError):
          path_resolve(testfile, strict=True)
  
      # If the file is created, it should not raise
      open("somefile.txt", "w").close()
      assert str(path_resolve(testfile, strict=True)) == resolved
  
imports: import os
  import time
  from pathlib import Path
  from unittest import mock, SkipTest
  import pytest
  from ...testing import TempFATFS
  from ...utils.filemanip import save_json, load_json, fname_presuffix, fnames_presuffix, hash_rename, check_forhash, _parse_mount_table, _cifs_table, on_cifs, copyfile, copyfiles, ensure_list, simplify_list, check_depends, split_filename, get_related_files, indirectory, loadpkl, loadcrash, savepkl, path_resolve, write_rst_list, emptydirs
label_desc: Use image node_id 28 for calling a global function with example usage: test_path_strict_resolve(tmpdir) without return types