From: Tarek Ziade Date: Mon, 23 May 2011 16:31:20 +0000 (+0200) Subject: make sure the cwd is restored on tearDown X-Git-Tag: v3.3.0a1~2183^2~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb64b61bf5c774fc0694287d5ad70061e1b94614;p=python make sure the cwd is restored on tearDown --- diff --git a/Lib/packaging/tests/test_config.py b/Lib/packaging/tests/test_config.py index 6f70817300..a27673014a 100644 --- a/Lib/packaging/tests/test_config.py +++ b/Lib/packaging/tests/test_config.py @@ -176,9 +176,14 @@ class ConfigTestCase(support.TempdirManager, self.addCleanup(os.chdir, os.getcwd()) tempdir = self.mkdtemp() + self.working_dir = os.getcwd() os.chdir(tempdir) self.tempdir = tempdir + def tearDown(self): + os.chdir(self.working_dir) + super(ConfigTestCase, self).tearDown() + def write_setup(self, kwargs=None): opts = {'description-file': 'README', 'extra-files': '', 'setup-hook': 'packaging.tests.test_config.hook'}