def chdir(self, path: str | os.PathLike[str]) -> None:
        """Change the current working directory to the specified path.

        :param path:
            The path to change into.
        """
        if self._cwd is None:
            self._cwd = os.getcwd()
        os.chdir(path)
Change the current working directory to the specified path.

        :param path:
            The path to change into.
        
src/_pytest/monkeypatch.py