mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Lint fixes
This commit is contained in:
parent
337c737229
commit
0e5bc67d4b
3 changed files with 6 additions and 18 deletions
|
@ -66,13 +66,11 @@ except ImportError:
|
|||
HAS_M2 = False
|
||||
try:
|
||||
from Cryptodome.Hash import SHA256
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Signature import PKCS1_v1_5
|
||||
HAS_REQUIRED_CRYPTO = True
|
||||
except ImportError:
|
||||
try:
|
||||
from Crypto.Hash import SHA256
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Signature import PKCS1_v1_5
|
||||
HAS_REQUIRED_CRYPTO = True
|
||||
except ImportError:
|
||||
|
|
|
@ -30,8 +30,13 @@ class PipModuleTest(ModuleCase):
|
|||
|
||||
def setUp(self):
|
||||
super(PipModuleTest, self).setUp()
|
||||
|
||||
# Restore the environ
|
||||
self.addCleanup(os.environ.update, os.environ.copy())
|
||||
def cleanup_environ(envcopy):
|
||||
os.environ.clear()
|
||||
os.environ.update(envcopy)
|
||||
|
||||
self.addCleanup(cleanup_environ, os.environ.copy())
|
||||
|
||||
self.venv_test_dir = tempfile.mkdtemp(dir=TMP)
|
||||
# Remove the venv test directory
|
||||
|
@ -72,20 +77,6 @@ class PipModuleTest(ModuleCase):
|
|||
kwargs = {}
|
||||
self.run_function('virtualenv.create', [path], **kwargs)
|
||||
|
||||
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')
|
||||
if 'PIP_BUILD_DIR' in os.environ:
|
||||
os.environ.pop('PIP_BUILD_DIR')
|
||||
|
||||
def _check_download_error(self, ret):
|
||||
'''
|
||||
Checks to see if a download error looks transitory
|
||||
|
|
|
@ -1076,6 +1076,5 @@ class DaemonMixInTestCase(TestCase):
|
|||
salt.utils.parsers.logger.debug.assert_not_called()
|
||||
|
||||
|
||||
|
||||
# Hide the class from unittest framework when it searches for TestCase classes in the module
|
||||
del LogSettingsParserTests
|
||||
|
|
Loading…
Add table
Reference in a new issue