mirror of
https://github.com/python/cpython.git
synced 2025-01-15 04:55:00 +08:00
fixed the cwd cleanup in packaging test_util
This commit is contained in:
parent
eb64b61bf5
commit
fabc30833f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user