Improve docs so regen doesn't leak temp directories (#6364)

Improve docs so regen doesn't leak temp directories
This commit is contained in:
Bruno Oliveira 2019-12-21 13:23:08 -03:00 committed by GitHub
commit 9924432a2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -1035,15 +1035,19 @@ file:
# content of conftest.py
import pytest
import tempfile
import os
import shutil
import tempfile
import pytest
@pytest.fixture()
def cleandir():
newpath = tempfile.mkdtemp()
os.chdir(newpath)
yield
shutil.rmtree(newpath)
and declare its use in a test module via a ``usefixtures`` marker: