mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
make sure the cwd is restored on tearDown
This commit is contained in:
parent
7870bdff5a
commit
eb64b61bf5
1 changed files with 5 additions and 0 deletions
|
|
@ -176,9 +176,14 @@ class ConfigTestCase(support.TempdirManager,
|
|||
|
||||
self.addCleanup(os.chdir, os.getcwd())
|
||||
tempdir = self.mkdtemp()
|
||||
self.working_dir = os.getcwd()
|
||||
os.chdir(tempdir)
|
||||
self.tempdir = tempdir
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(self.working_dir)
|
||||
super(ConfigTestCase, self).tearDown()
|
||||
|
||||
def write_setup(self, kwargs=None):
|
||||
opts = {'description-file': 'README', 'extra-files': '',
|
||||
'setup-hook': 'packaging.tests.test_config.hook'}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue