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

Function absolutepath

src/_pytest/pathlib.py:989–995  ·  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: str | os.PathLike[str])

Source from the content-addressed store, hash-verified

987
988
989def absolutepath(path: str | os.PathLike[str]) -> Path:
990 """Convert a path to an absolute path using os.path.abspath.
991
992 Prefer this over Path.resolve() (see #6523).
993 Prefer this over Path.absolute() (not public, doesn't normalize).
994 """
995 return Path(os.path.abspath(path))
996
997
998def commonpath(path1: Path, path2: Path) -> Path | None:

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