update documentation for the new monkeypatch.chdir method

This commit is contained in:
Ralf Schmitt 2012-01-06 15:25:57 +01:00
parent 93424b0f9c
commit adbbd164ff
2 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ Changes between 2.2.1 and 2.2.2.dev
test directory was renamed and some pyc/__pycache__ remain
- fix issue106: allow parametrize to be applied multiple times
e.g. from module, class and at function level.
- add chdir method to monkeypatch funcarg
Changes between 2.2.0 and 2.2.1
----------------------------------------

View File

@ -13,6 +13,7 @@ def pytest_funcarg__monkeypatch(request):
monkeypatch.setenv(name, value, prepend=False)
monkeypatch.delenv(name, value, raising=True)
monkeypatch.syspath_prepend(path)
monkeypatch.chdir(path)
All modifications will be undone after the requesting
test function has finished. The ``raising``
@ -85,6 +86,9 @@ class monkeypatch:
sys.path.insert(0, str(path))
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"):