From: Tarek Ziade Date: Mon, 23 May 2011 16:47:27 +0000 (+0200) Subject: fixed the cwd cleanup in packaging test_util X-Git-Tag: v3.3.0a1~2183^2~145 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fabc30833f9bab8d1d028c1295259d85be96a789;p=python fixed the cwd cleanup in packaging test_util --- diff --git a/Lib/packaging/tests/test_util.py b/Lib/packaging/tests/test_util.py index 29f53790fa..61b4ec76f3 100644 --- a/Lib/packaging/tests/test_util.py +++ b/Lib/packaging/tests/test_util.py @@ -526,11 +526,18 @@ class GlobTestCaseBase(support.TempdirManager, class GlobTestCase(GlobTestCaseBase): + def setUp(self): + super(GlobTestCase, self).setUp() + self.cwd = os.getcwd() + + def tearDown(self): + os.chdir(self.cwd) + super(GlobTestCase, self).tearDown() + def assertGlobMatch(self, glob, spec): """""" tempdir = self.build_files_tree(spec) expected = self.clean_tree(spec) - self.addCleanup(os.chdir, os.getcwd()) os.chdir(tempdir) result = list(iglob(glob)) self.assertCountEqual(expected, result)