From e881ebbfc610e14323246526e19b3ed33e8df050 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 11 Feb 2017 14:01:04 -0500 Subject: Use the test-specific chdir method --- tests/test_api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/test_api.py') diff --git a/tests/test_api.py b/tests/test_api.py index eaeabcb..7530aca 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -376,9 +376,7 @@ class UsingModulesMixin(object): def setUp(self): super(UsingModulesMixin, self).setUp() - old_dir = os.getcwd() - os.chdir(self.nice_file(os.path.dirname(__file__), 'modules')) - self.addCleanup(os.chdir, old_dir) + self.chdir(self.nice_file(os.path.dirname(__file__), 'modules')) # Parent class saves and restores sys.path, we can just modify it. sys.path.append(".") -- cgit v1.2.1