This repository was archived by the owner on Aug 7, 2024. It is now read-only.

Description
The following code goes in doctest_global_setup in docs/conf.py
import os
import shutil
import atexit
import tempfile
import functools
# Create a temporary directory for test to run in
TEMPDIR = tempfile.mkdtemp()
# Remove it when the test exits
atexit.register(functools.partial(shutil.rmtree, TEMPDIR))
# Change the current working directory to the temporary directory
os.chdir(TEMPDIR)