Add _sys_snapshot fixture and use it with more tests
This commit is contained in:
@@ -335,6 +335,15 @@ def testdir(request, tmpdir_factory):
|
||||
return Testdir(request, tmpdir_factory)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def _sys_snapshot():
|
||||
snappaths = SysPathsSnapshot()
|
||||
snapmods = SysModulesSnapshot()
|
||||
yield
|
||||
snapmods.restore()
|
||||
snappaths.restore()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def _config_for_test():
|
||||
from _pytest.config import get_config
|
||||
|
||||
Reference in New Issue
Block a user