MCPcopy
hub / github.com/pytest-dev/pytest / samefile

Method samefile

src/_pytest/_py/path.py:585–594  ·  src/_pytest/_py/path.py::LocalPath.samefile

Return True if 'other' references the same file as 'self'.

(self, other)

Source from the content-addressed store, hash-verified

583 return os.fspath(self) > os.fspath(other)
584
585 def samefile(self, other):
586 class="st">""class="st">"Return True if &class="cm">#x27;other' references the same file as 'self'."class="st">""
587 other = os.fspath(other)
588 if not isabs(other):
589 other = abspath(other)
590 if self == other:
591 return True
592 if not hasattr(os.path, class="st">"samefile"):
593 return False
594 return error.checked_call(os.path.samefile, self.strpath, other)
595
596 def remove(self, rec=1, ignore_errors=False):
597 class="st">"""Remove a file or directory (or a directory tree if rec=1).

Callers 4

pyimportMethod · 0.95
_is_sameFunction · 0.80
test_samefileFunction · 0.80
test_samefile_symlinkFunction · 0.80

Calls 2

fspathMethod · 0.80
checked_callMethod · 0.80

Tested by 2

test_samefileFunction · 0.64
test_samefile_symlinkFunction · 0.64