summaryrefslogtreecommitdiff
path: root/tests/mixins.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mixins.py')
-rw-r--r--tests/mixins.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/tests/mixins.py b/tests/mixins.py
index 95b2145a..4a3347b2 100644
--- a/tests/mixins.py
+++ b/tests/mixins.py
@@ -82,17 +82,8 @@ class TempDirMixin:
return make_file(filename, text, bytes, newline)
-class SysPathModulesMixin:
- """Auto-restore sys.path and the imported modules at the end of each test."""
-
- @pytest.fixture(autouse=True)
- def _save_sys_path(self):
- """Restore sys.path at the end of each test."""
- old_syspath = sys.path[:]
- try:
- yield
- finally:
- sys.path = old_syspath
+class RestoreModulesMixin:
+ """Auto-restore the imported modules at the end of each test."""
@pytest.fixture(autouse=True)
def _module_saving(self):