@pytest.fixture(scope='function', autouse=True)
def set_htmap_dir_and_clean(tmpdir_factory):
    map_dir = Path(tmpdir_factory.mktemp('htmap_dir'))
    htmap.settings['HTMAP_DIR'] = map_dir
    ensure_htmap_dir_exists()
    (yield)
    htmap.clean(all=True)
@pytest.fixture(scope='function', autouse=True)
def set_htmap_dir_and_clean(tmpdir_factory):
    map_dir = Path(tmpdir_factory.mktemp('htmap_dir'))
    htmap.settings['HTMAP_DIR'] = map_dir
    ensure_htmap_dir_exists()
    (yield)
    htmap.clean(all=True)