]> granicus.if.org Git - python/commitdiff
fixed the cwd cleanup in packaging test_util
authorTarek Ziade <tarek@ziade.org>
Mon, 23 May 2011 16:47:27 +0000 (18:47 +0200)
committerTarek Ziade <tarek@ziade.org>
Mon, 23 May 2011 16:47:27 +0000 (18:47 +0200)
Lib/packaging/tests/test_util.py

index 29f53790fadb63ccd2780a53e0b0a5dfe67e87cf..61b4ec76f3620fcb0b4feff737afc9fc31f7abdd 100644 (file)
@@ -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)