Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/en/fixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1042,11 +1042,13 @@ file:
import pytest


@pytest.fixture()
@pytest.fixture
def cleandir():
old_cwd = os.getcwd()
newpath = tempfile.mkdtemp()
os.chdir(newpath)
yield
os.chdir(old_cwd)
shutil.rmtree(newpath)

and declare its use in a test module via a ``usefixtures`` marker:
Expand Down