summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMatt Clay <mclay@redhat.com>2021-09-03 15:17:43 -0700
committerGitHub <noreply@github.com>2021-09-03 15:17:43 -0700
commitde01db08d00c8d2438e1ba5989c313ba16a145b0 (patch)
treefb57551a10cf0efc643d5cecb59df4c730f5bad2 /test
parentfc8197e32675dd0343939f107b5f017993e36f62 (diff)
downloadansible-de01db08d00c8d2438e1ba5989c313ba16a145b0.tar.gz
pip - Use pip from the current Python interpreter. (#75634)
* pip - Use pip from the current Python interpreter. If `executable` and `virtualenv` were not specified, and the `pip` Python module is available for the current interpreter, use that `pip` module instead of searching for a `pip` command. * Add comment about needing `__main__` to run `pip`. * Fix unit test. * Add porting guide entry. * Update changelog to match porting guide description. ci_complete
Diffstat (limited to 'test')
-rw-r--r--test/units/modules/test_pip.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/units/modules/test_pip.py b/test/units/modules/test_pip.py
index 7f0f8b079a..5640b80582 100644
--- a/test/units/modules/test_pip.py
+++ b/test/units/modules/test_pip.py
@@ -15,6 +15,8 @@ pytestmark = pytest.mark.usefixtures('patch_ansible_module')
@pytest.mark.parametrize('patch_ansible_module', [{'name': 'six'}], indirect=['patch_ansible_module'])
def test_failure_when_pip_absent(mocker, capfd):
+ mocker.patch('ansible.modules.pip._have_pip_module').return_value = False
+
get_bin_path = mocker.patch('ansible.module_utils.basic.AnsibleModule.get_bin_path')
get_bin_path.return_value = None