diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-14 20:03:57 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-14 20:03:57 -0400 |
commit | 4a5cf280fe8622a4ccd03c07cdd6adf3207df20f (patch) | |
tree | 513d76089b6af0bacfa282ab4418dd554e1f3b57 /tests/mixins.py | |
parent | ec9070f1387e9713236f3b8c47447df44447df23 (diff) | |
download | python-coveragepy-git-4a5cf280fe8622a4ccd03c07cdd6adf3207df20f.tar.gz |
test: we don't need two sys.path restorers
Diffstat (limited to 'tests/mixins.py')
-rw-r--r-- | tests/mixins.py | 13 |
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): |