summaryrefslogtreecommitdiff
path: root/src/_pytest/pathlib.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/_pytest/pathlib.py')
-rw-r--r--src/_pytest/pathlib.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py
index 8875a28f8..2e452eb1c 100644
--- a/src/_pytest/pathlib.py
+++ b/src/_pytest/pathlib.py
@@ -30,8 +30,6 @@ from typing import Set
from typing import TypeVar
from typing import Union
-import py
-
from _pytest.compat import assert_never
from _pytest.outcomes import skip
from _pytest.warning_types import PytestWarning
@@ -456,7 +454,7 @@ class ImportPathMismatchError(ImportError):
def import_path(
- p: Union[str, py.path.local, Path],
+ p: Union[str, "os.PathLike[str]"],
*,
mode: Union[str, ImportMode] = ImportMode.prepend,
) -> ModuleType:
@@ -482,7 +480,7 @@ def import_path(
"""
mode = ImportMode(mode)
- path = Path(str(p))
+ path = Path(p)
if not path.exists():
raise ImportError(path)