MCPcopy Create free account
hub / github.com/pytest-dev/pytest / absolutepath

Function absolutepath

src/_pytest/pathlib.py:659–665  ·  view source on GitHub ↗

Convert a path to an absolute path using os.path.abspath. Prefer this over Path.resolve() (see #6523). Prefer this over Path.absolute() (not public, doesn't normalize).

(path: Union[Path, str])

Source from the content-addressed store, hash-verified

657
658
659def absolutepath(path: Union[Path, str]) -> Path:
660 """Convert a path to an absolute path using os.path.abspath.
661
662 Prefer this over Path.resolve() (see #6523).
663 Prefer this over Path.absolute() (not public, doesn't normalize).
664 """
665 return Path(os.path.abspath(str(path)))
666
667
668def commonpath(path1: Path, path2: Path) -> Optional[Path]:

Callers 15

get_locationMethod · 0.90
locationMethod · 0.90
pytest_ignore_collectFunction · 0.90
_should_rewriteMethod · 0.90
pathMethod · 0.90
getfslinenoFunction · 0.90
_getconftest_pathlistMethod · 0.90
locate_configFunction · 0.90

Calls

no outgoing calls

Tested by 1

test_inifilenameMethod · 0.72