diff --git a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml index 67ff49b2..6be85959 100644 --- a/tests/ansible/regression/issue_152__virtualenv_python_fails.yml +++ b/tests/ansible/regression/issue_152__virtualenv_python_fails.yml @@ -1,5 +1,6 @@ - name: regression/issue_152__virtualenv_python_fails.yml any_errors_fatal: true + gather_facts: true hosts: test-targets tasks: - custom_python_detect_environment: @@ -14,6 +15,10 @@ no_proxy: "{{ lookup('env', 'no_proxy')|default('') }}" PATH: "{{ lookup('env', 'PATH') }}" + # virtualenv on Mac points to /usr/local/Cellar/python/3.7.2_1/bin/python3.7 as the sys.executable + # which matches up with the .Python set up in /tmp/issue_152_virtualenv: + # .Python -> /usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/Python + # on Mac, lout's sys.executable is the normal /usr/bin/python - custom_python_detect_environment: vars: ansible_python_interpreter: /tmp/issue_152_virtualenv/bin/python @@ -23,7 +28,12 @@ - assert: that: - out.sys_executable == "/tmp/issue_152_virtualenv/bin/python" - when: lout.python_version > '2.6' + when: lout.python_version > '2.6' and ansible_os_family != 'Darwin' + + - assert: + that: + - "'/usr/local/Cellar/python' in out.sys_executable" + when: lout.python_version > '2.6' and ansible_os_family == 'Darwin' - file: path: /tmp/issue_152_virtualenv diff --git a/tests/ansible/requirements.txt b/tests/ansible/requirements.txt index bed4ea02..9e2e40f9 100644 --- a/tests/ansible/requirements.txt +++ b/tests/ansible/requirements.txt @@ -1,4 +1,4 @@ -ansible==2.8.3; python_version >= '2.7' +ansible==2.9.4; python_version >= '2.7' ansible<2.7; python_version < '2.7' paramiko==2.3.2 # Last 2.6-compat version. hdrhistogram==0.6.1