From a14a9337c6a0c96e223f58ea6af3c6d330a51baf Mon Sep 17 00:00:00 2001 From: Tim Way <1091435+timway@users.noreply.github.com> Date: Fri, 25 Feb 2022 01:32:23 -0600 Subject: [PATCH] Add 'netaddr' To 'requirements.txt' For Unit Tests (#143) Add 'netaddr' To 'requirements.txt' For Unit Tests This enables 'ansible-test --docker' and 'ansible-test --venv' to be able to leverage 'netaddr' and pass tests SUMMARY This adds the 'netaddr' python module to the requirements specific to unit tests. This allows 'ansible-test' to work for '--docker' and '--venv' without manual intervention. I also re-ordered the current list to be alphabetical. Fixes #142 ISSUE TYPE Bugfix Pull Request COMPONENT NAME Unit tests in ansible.utils for ipsubnet ADDITIONAL INFORMATION git clone https://github.com/ansible-collections/ansible.utils.git cd ansible.utils ansible-galaxy collection build . ansible-galaxy collection install -p . ansible-utils-\*.tar.gz ansible-test units --docker base tests/unit/plugins/filter/test_ipsubnet.py --requirements --verbose Reviewed-by: Ashwini Mhatre --- changelogs/fragments/unit_test_container_venv.yaml | 7 +++++++ tests/unit/requirements.txt | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/unit_test_container_venv.yaml diff --git a/changelogs/fragments/unit_test_container_venv.yaml b/changelogs/fragments/unit_test_container_venv.yaml new file mode 100644 index 0000000..02f7064 --- /dev/null +++ b/changelogs/fragments/unit_test_container_venv.yaml @@ -0,0 +1,7 @@ +--- +trivial: + - >- + unit-testing - adds the python netaddr module as a requirement that + ansible-test will install when operating in container (--docker) or python + virtual environment (--venv) mode. + (https://github.com/ansible-collections/ansible.utils/issues/142) diff --git a/tests/unit/requirements.txt b/tests/unit/requirements.txt index bb541da..7280dcf 100644 --- a/tests/unit/requirements.txt +++ b/tests/unit/requirements.txt @@ -1,4 +1,5 @@ -unittest2 ; python_version < '2.7' jsonschema ; python_version >= '2.7' -ttp +netaddr textfsm +ttp +unittest2 ; python_version < '2.7'