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

Method chdir

src/_pytest/monkeypatch.py:338–345  ·  view source on GitHub ↗

Change the current working directory to the specified path. Path can be a string or a path object.

(self, path: Union[str, "os.PathLike[str]"])

Source from the content-addressed store, hash-verified

336 invalidate_caches()
337
338 def chdir(self, path: Union[str, "os.PathLike[str]"]) -> None:
339 """Change the current working directory to the specified path.
340
341 Path can be a string or a path object.
342 """
343 if self._cwd is None:
344 self._cwd = os.getcwd()
345 os.chdir(path)
346
347 def undo(self) -> None:
348 """Undo previous changes.

Callers 1

undoMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected