summaryrefslogtreecommitdiff
path: root/tests/test_api.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index 00f6dbe8..b0752730 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -371,15 +371,13 @@ class UsingModulesMixin(object):
def setUp(self):
super(UsingModulesMixin, self).setUp()
# Parent class saves and restores sys.path, we can just modify it.
- self.old_dir = os.getcwd()
+ old_dir = os.getcwd()
os.chdir(self.nice_file(os.path.dirname(__file__), 'modules'))
+ self.addCleanup(os.chdir, old_dir)
+
sys.path.append(".")
sys.path.append("../moremodules")
- def tearDown(self):
- os.chdir(self.old_dir)
- super(UsingModulesMixin, self).tearDown()
-
class OmitIncludeTestsMixin(UsingModulesMixin):
"""Test methods for coverage methods taking include and omit."""