mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #48871 from dwoz/test_cleanup
Remove unicode key pairs from environ after test
This commit is contained in:
commit
d4bb3a0963
1 changed files with 12 additions and 10 deletions
|
@ -42,6 +42,18 @@ class PipModuleTest(ModuleCase):
|
|||
os.makedirs(self.pip_temp)
|
||||
os.environ['PIP_SOURCE_DIR'] = os.environ['PIP_BUILD_DIR'] = ''
|
||||
|
||||
def tearDown(self):
|
||||
super(PipModuleTest, self).tearDown()
|
||||
if os.path.isdir(self.venv_test_dir):
|
||||
shutil.rmtree(self.venv_test_dir, ignore_errors=True)
|
||||
if os.path.isdir(self.pip_temp):
|
||||
shutil.rmtree(self.pip_temp, ignore_errors=True)
|
||||
del self.venv_dir
|
||||
del self.venv_test_dir
|
||||
del self.pip_temp
|
||||
if 'PIP_SOURCE_DIR' in os.environ:
|
||||
os.environ.pop('PIP_SOURCE_DIR')
|
||||
|
||||
def _check_download_error(self, ret):
|
||||
'''
|
||||
Checks to see if a download error looks transitory
|
||||
|
@ -440,13 +452,3 @@ class PipModuleTest(ModuleCase):
|
|||
ret2 = self.run_function('cmd.run', '/bin/pip3 freeze | grep lazyimport')
|
||||
assert 'lazyimport==0.0.1' in ret1
|
||||
assert ret2 == ''
|
||||
|
||||
def tearDown(self):
|
||||
super(PipModuleTest, self).tearDown()
|
||||
if os.path.isdir(self.venv_test_dir):
|
||||
shutil.rmtree(self.venv_test_dir, ignore_errors=True)
|
||||
if os.path.isdir(self.pip_temp):
|
||||
shutil.rmtree(self.pip_temp, ignore_errors=True)
|
||||
del self.venv_dir
|
||||
del self.venv_test_dir
|
||||
del self.pip_temp
|
||||
|
|
Loading…
Add table
Reference in a new issue