diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-24 09:53:53 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-24 09:53:53 -0400 |
commit | 20baf284341555803d800ec4c248fd0f1b5351f1 (patch) | |
tree | 315429176663e477a732c2fe9c0ad42f63fde0f3 /tests/mixins.py | |
parent | 4902b6c53740c8e871bb03e69e4345c5cafad96e (diff) | |
download | python-coveragepy-git-20baf284341555803d800ec4c248fd0f1b5351f1.tar.gz |
refactor(test): os_sep and remove_tree helpers
Diffstat (limited to 'tests/mixins.py')
-rw-r--r-- | tests/mixins.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/tests/mixins.py b/tests/mixins.py index 4a3347b2..1043c2d2 100644 --- a/tests/mixins.py +++ b/tests/mixins.py @@ -10,13 +10,12 @@ Some of these are transitional while working toward pure-pytest style. import importlib import os import os.path -import shutil import sys import pytest from coverage.misc import SysModuleSaver -from tests.helpers import change_dir, make_file, remove_files +from tests.helpers import change_dir, make_file, remove_files, remove_tree class PytestBase: @@ -108,9 +107,7 @@ class RestoreModulesMixin: # 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__") - + remove_tree("__pycache__") importlib.invalidate_caches() |