class_docstr: Object returned by the ``monkeypatch`` fixture keeping a record of setattr/item/env/syspath changes.
      
class_docstr_tok: ["Object","returned","by","the","``","monkeypatch","``","fixture","keeping","a","record","of","setattr\/item\/env\/syspath","changes","."]
docstr: Change the current working directory to the specified path.
  Path can be a string or a py.path.local object.
docstr_tok: ["Change","the","current","working","directory","to","the","specified","path",".","Path","can","be","a","string","or","a","py.path.local","object","."]
code: def chdir(self, path):
      """Change the current working directory to the specified path.
      Path can be a string or a py.path.local object.
      """
      if self._cwd is None:
          self._cwd = os.getcwd()
      if hasattr(path, "chdir"):
          path.chdir()
      elif isinstance(path, Path):
          # modern python uses the fspath protocol here LEGACY
          os.chdir(str(path))
      else:
          os.chdir(path)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import re
  import sys
  import warnings
  from contextlib import contextmanager
  import six
  import pytest
  from _pytest.fixtures import fixture
  from _pytest.pathlib import Path
label_desc: Use image node_id 11 for calling the MonkeyPatch obj's underlying member method code with example usage: obj.chdir(path) without return types