Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Abdeali JK
Abdelrahman Elbehery
Abhijeet Kasurde
ace2016
Adam Dangoor
Adam Johnson
Adam Stewart
Adam Uhlir
Expand Down
1 change: 1 addition & 0 deletions changelog/14988.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:meth:`MonkeyPatch.syspath_prepend <pytest.MonkeyPatch.syspath_prepend>` now annotates its ``path`` parameter as ``str | os.PathLike[str]``, so strict type checkers no longer report calls to it as having an unknown type.
2 changes: 1 addition & 1 deletion src/_pytest/monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def delenv(self, name: str, raising: bool = True) -> None:
environ: MutableMapping[str, str] = os.environ
self.delitem(environ, name, raising=raising)

def syspath_prepend(self, path) -> None:
def syspath_prepend(self, path: str | os.PathLike[str]) -> None:
"""Prepend ``path`` to ``sys.path`` list of import locations."""
if self._savesyspath is None:
self._savesyspath = sys.path[:]
Expand Down