diff options
Diffstat (limited to 'tests/helpers.py')
-rw-r--r-- | tests/helpers.py | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 195fefde..d4dd33ea 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -8,15 +8,13 @@ import contextlib import glob import os import re -import shutil import subprocess import sys import mock -from unittest_mixins import ModuleCleaner from coverage import env -from coverage.backward import invalidate_import_caches, unicode_class +from coverage.backward import unicode_class from coverage.misc import output_encoding @@ -115,29 +113,6 @@ def remove_files(*patterns): os.remove(fname) -class SuperModuleCleaner(ModuleCleaner): - """Remember the state of sys.modules and restore it later.""" - - def clean_local_file_imports(self): - """Clean up the results of calls to `import_local_file`. - - Use this if you need to `import_local_file` the same file twice in - one test. - - """ - # So that we can re-import files, clean them out first. - self.cleanup_modules() - - # Also have to clean out the .pyc file, since the timestamp - # resolution is only one second, a changed file might not be - # picked up. - remove_files("*.pyc", "*$py.class") - if os.path.exists("__pycache__"): - shutil.rmtree("__pycache__") - - invalidate_import_caches() - - # Map chars to numbers for arcz_to_arcs _arcz_map = {'.': -1} _arcz_map.update(dict((c, ord(c) - ord('0')) for c in '123456789')) |