Fix pip integration test.

- Use `fallible==0.0.1a2` instead of `black==19.10b`
- Test on both Python 2 and 3.
pull/76276/head
Matt Clay 3 years ago
parent be2bd2f1af
commit b6725ec6c9

@ -573,27 +573,24 @@
# https://github.com/ansible/ansible/issues/68592 # https://github.com/ansible/ansible/issues/68592
# Handle pre-release version numbers in check_mode for already-installed # Handle pre-release version numbers in check_mode for already-installed
# packages. # packages.
# TODO: Limiting to py3 test boxes for now so the example of 'black' installs,
# we should probably find another package to use with a similar versioning
# scheme or make a small one and enable this test for py2 as well.
- block: - block:
- name: Install a beta version of a package - name: Install a pre-release version of a package
pip: pip:
name: black name: fallible
version: 19.10b0 version: 0.0.1a2
state: present state: present
- name: Use check_mode and ensure that the package is shown as installed - name: Use check_mode and ensure that the package is shown as installed
check_mode: true check_mode: true
pip: pip:
name: black name: fallible
state: present state: present
register: pip_prereleases register: pip_prereleases
- name: Uninstall the beta package if we need to - name: Uninstall the pre-release package if we need to
pip: pip:
name: black name: fallible
version: 19.10b0 version: 0.0.1a2
state: absent state: absent
when: pip_prereleases is changed when: pip_prereleases is changed
@ -601,6 +598,4 @@
that: that:
- pip_prereleases is successful - pip_prereleases is successful
- pip_prereleases is not changed - pip_prereleases is not changed
- '"black==19.10b0" in pip_prereleases.stdout_lines' - '"fallible==0.0.1a2" in pip_prereleases.stdout_lines'
when: ansible_python.version.major == 3

Loading…
Cancel
Save