-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
I think this could be done with a fixture:
@pytest.fixture
def temporary_environ():
old_environ = os.environ.copy()
yield
os.environ = old_environThen on the test:
@pytest.mark.usefixtures("temporary_environ")
def test_init_with_existing_cachedir(fixture_dir, requests_mock, tmpdir):I think you can even stack it:
@pytest.fixture
def temporary_xdg_cache_home(tmpdir):
old_environ = os.environ.copy()
os.environ['XDG_CACHE_HOME'] = tmpdir.strpath
yield
os.environ = old_environMetadata
Metadata
Assignees
Labels
No labels