summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTarek Ziade <tarek@ziade.org>2011-05-23 16:47:27 (GMT)
committerTarek Ziade <tarek@ziade.org>2011-05-23 16:47:27 (GMT)
commitfabc30833f9bab8d1d028c1295259d85be96a789 (patch)
treea282d23de0bb2ae65d0d4b7ad8e372e50942552e
parenteb64b61bf5c774fc0694287d5ad70061e1b94614 (diff)
downloadcpython-fabc30833f9bab8d1d028c1295259d85be96a789.zip
cpython-fabc30833f9bab8d1d028c1295259d85be96a789.tar.gz
cpython-fabc30833f9bab8d1d028c1295259d85be96a789.tar.bz2
fixed the cwd cleanup in packaging test_util
-rw-r--r--Lib/packaging/tests/test_util.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/packaging/tests/test_util.py b/Lib/packaging/tests/test_util.py
index 29f5379..61b4ec7 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)