Merge pull request #53210 from Ch3LL/cp-52787

Cherry-Pick #52787 into 2019.2.1
This commit is contained in:
Megan Wilhite 2019-06-20 09:33:12 -04:00 committed by GitHub
commit f5f80af440
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 25 deletions

View file

@ -66,8 +66,8 @@ if HAS_PIP is True:
ver2='18.1'):
from pip._internal.exceptions import InstallationError # pylint: disable=E0611,E0401
elif salt.utils.versions.compare(ver1=pip.__version__,
oper='>=',
ver2='10.0'):
oper='>=',
ver2='1.0'):
from pip.exceptions import InstallationError # pylint: disable=E0611,E0401
else:
InstallationError = ValueError

View file

@ -3,7 +3,9 @@
- system_site_packages: False
- distribute: True
{#- Provide the real path for the python executable in case tests are running inside a virtualenv #}
{%- if salt.runtests_helpers.get_python_executable() %}
- python: {{ salt.runtests_helpers.get_python_executable() }}
{%- endif %}
pep8-pip:
pip.installed:

View file

@ -6,7 +6,9 @@
- system_site_packages: False
- distribute: True
{#- Provide the real path for the python executable in case tests are running inside a virtualenv #}
{%- if salt.runtests_helpers.get_python_executable() %}
- python: {{ salt.runtests_helpers.get_python_executable() }}
{%- endif %}
install_older_venv_1:
pip.installed:

View file

@ -2034,6 +2034,7 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
for id in _expected:
self.assertEqual(sls[id]['comment'], _expected[id]['comment'])
@skipIf(six.PY3 and salt.utils.platform.is_darwin(), 'Test is broken on macosx and PY3')
def test_state_sls_unicode_characters(self):
'''
test state.sls when state file contains non-ascii characters
@ -2044,6 +2045,7 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
_expected = "cmd_|-echo1_|-echo 'This is Æ test!'_|-run"
self.assertIn(_expected, ret)
@skipIf(six.PY3 and salt.utils.platform.is_darwin(), 'Test is broken on macosx and PY3')
def test_state_sls_unicode_characters_cmd_output(self):
'''
test the output from running and echo command with non-ascii

View file

@ -49,6 +49,7 @@ class MinionTest(ShellCase, testprogram.TestProgramCase, ShellCaseCommonTestsMix
'subminion',
)
@skipIf(salt.utils.platform.is_darwin(), 'Test is flaky on macosx')
def test_issue_7754(self):
old_cwd = os.getcwd()
config_dir = os.path.join(TMP, 'issue-7754')

View file

@ -256,29 +256,6 @@ class PipStateTest(TestCase, SaltReturnAssertsMixin, LoaderModuleMockMixin):
{'test': ret}
)
# Test VCS installations with version info like >= 0.1
with patch.object(pip, '__version__', MagicMock(side_effect=AttributeError(
'Faked missing __version__ attribute'))):
mock = MagicMock(return_value={'retcode': 0, 'stdout': ''})
pip_list = MagicMock(return_value={'SaltTesting': '0.5.0'})
pip_install = MagicMock(return_value={
'retcode': 0,
'stderr': '',
'stdout': 'Cloned!'
})
with patch.dict(pip_state.__salt__, {'cmd.run_all': mock,
'pip.list': pip_list,
'pip.install': pip_install}):
with patch.dict(pip_state.__opts__, {'test': False}):
ret = pip_state.installed(
'git+https://github.com/saltstack/salt-testing.git#egg=SaltTesting>=0.5.0'
)
self.assertSaltTrueReturn({'test': ret})
self.assertInSaltComment(
'packages are already installed',
{'test': ret}
)
def test_install_in_editable_mode(self):
'''
Check that `name` parameter containing bad characters is not parsed by