Improve docs so regen doesn't leak temp directories (#6364)
Improve docs so regen doesn't leak temp directories
This commit is contained in:
commit
9924432a2e
|
@ -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:
|
||||
|
||||
|
|
Loading…
Reference in New Issue