[Python-checkins] cpython: fixed the cwd cleanup in packaging test_util

tarek.ziade python-checkins at python.org
Mon May 23 18:47:33 CEST 2011


http://hg.python.org/cpython/rev/0d0d46e1bdaf
changeset:   70299:0d0d46e1bdaf
user:        Tarek Ziade <tarek at ziade.org>
date:        Mon May 23 18:47:27 2011 +0200
summary:
  fixed the cwd cleanup in packaging test_util

files:
  Lib/packaging/tests/test_util.py |  9 ++++++++-
  1 files changed, 8 insertions(+), 1 deletions(-)


diff --git a/Lib/packaging/tests/test_util.py b/Lib/packaging/tests/test_util.py
--- a/Lib/packaging/tests/test_util.py
+++ b/Lib/packaging/tests/test_util.py
@@ -526,11 +526,18 @@
 
 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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list