mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
fixed the cwd cleanup in packaging test_util
This commit is contained in:
parent
eb64b61bf5
commit
fabc30833f
1 changed files with 8 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue