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

Method chdir

src/_pytest/monkeypatch.py:379–387  ·  view source on GitHub ↗

Change the current working directory to the specified path. :param path: The path to change into.

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

Source from the content-addressed store, hash-verified

377 invalidate_caches()
378
379 def chdir(self, path: str | os.PathLike[str]) -> None:
380 """Change the current working directory to the specified path.
381
382 :param path:
383 The path to change into.
384 """
385 if self._cwd is None:
386 self._cwd = os.getcwd()
387 os.chdir(path)
388
389 def undo(self) -> None:
390 """Undo previous changes.

Callers 1

undoMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected