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

Method dirpath

src/_pytest/_py/path.py:709–717  ·  view source on GitHub ↗

Return the directory path joined with any given path arguments.

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

707 return res
708
709 def dirpath(self, *args, **kwargs):
710 """Return the directory path joined with any given path arguments."""
711 if not kwargs:
712 path = object.__new__(self.__class__)
713 path.strpath = dirname(self.strpath)
714 if args:
715 path = path.join(*args)
716 return path
717 return self.new(basename="").join(*args, **kwargs)
718
719 def join(self, *args: os.PathLike[str], abs: bool = False) -> LocalPath:
720 """Return a new path by appending all 'args' as path

Callers 15

openMethod · 0.95
write_binaryMethod · 0.95
write_textMethod · 0.95
writeMethod · 0.95
_ensuredirsMethod · 0.95
pyimportMethod · 0.95
partsMethod · 0.80
copyMethod · 0.80
ensureMethod · 0.80
test_dirpathMethod · 0.80
test_newbasenameMethod · 0.80

Calls 2

newMethod · 0.95
joinMethod · 0.80

Tested by 12

test_dirpathMethod · 0.64
test_newbasenameMethod · 0.64
test_bestrelpathMethod · 0.64
test_move_fileMethod · 0.64
test_tmprootMethod · 0.64
test_sysfindMethod · 0.64
test_sysfind_multipleMethod · 0.64
test_samefileFunction · 0.64
test_copy_archivingMethod · 0.64