@contextmanager
def temp_directory():
    directory = tempfile.mkdtemp()
    try:
        yield directory
    finally:
        shutil.rmtree(directory)
This context manager gives the path to a new temporary directory that is
dataset/ETHPy150Open SimonSapin/Flask-FlatPages/tests/test_temp_directory.py/temp_directory