You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/lib/ansible_test/_internal
Matt Clay 77c2139f7e [stable-2.9] Fix ansible-test pytest plugin loading. (#62119) (#62120)
* [stable-2.9] Fix ansible-test pytest plugin loading. (#62119)

* Avoid assertion rewriting in pytest plugins.

Adding PYTEST_DONT_REWRITE to the ansible-test pytest plugin docstrings disables assertion rewriting in pytest for those plugins.

This avoids warnings during test execution if the plugins are loaded multiple times (such as being imported within tests).

* Run ansible-test pytest plugins early.

The ansible-test pytest plugins need to load and run earlier than conftest modules.

To facilitate this, the pytest_configure function is run during loading, which works since they are loaded (but not always run) before conftest modules are loaded.

A check has also been added to the pytest_configure functions to prevent them from running multiple times in the same process.

* Load pytest plugins using an env var.

The -p command line option loads plugins before conftest, but only during collection.
The PYTEST_PLUGINS environment variable loads plugins before confest, both during collection and test execution.
(cherry picked from commit aaa6d2e)

Co-authored-by: Matt Clay <matt@mystile.com>

* Add missing changelog entry for ansible-test fix.

PR https://github.com/ansible/ansible/pull/62119 was missing a changelog entry.

(cherry picked from commit 6c78f02121)
5 years ago
..
cloud ansible-test: vcenter+Worldstream: hide password 5 years ago
integration Update collections integration targets path. (#61523) 5 years ago
provider [stable-2.9] Fix ansible-test to ignore `tests/output/`. (#62084) 5 years ago
sanity [stable-2.9] Fix issues with ansible-test --venv option. (#62033) 5 years ago
units [stable-2.9] Fix ansible-test pytest plugin loading. (#62119) (#62120) 5 years ago
__init__.py Relocate ansible-test code. (#60147) 5 years ago
ansible_util.py Overhaul ansible-test test path handling. (#61416) 5 years ago
cache.py Relocate ansible-test code. (#60147) 5 years ago
changes.py Relocate ansible-test code. (#60147) 5 years ago
classification.py More ansible-test path handling updates. (#61484) 5 years ago
cli.py Add a --venv option to ansible-test. (#61422) 5 years ago
config.py Add a --venv option to ansible-test. (#61422) 5 years ago
constants.py Relocate ansible-test code. (#60147) 5 years ago
core_ci.py Overhaul ansible-test test path handling. (#61416) 5 years ago
cover.py Fix ansible-test coverage --all (#62115) 5 years ago
coverage_util.py [stable-2.9] Properly exclude tests/output/ from code coverage. 5 years ago
csharp_import_analysis.py Change collection PS util import pattern (#61307) 5 years ago
data.py More ansible-test path handling updates. (#61484) 5 years ago
delegation.py [stable-2.9] Fix issues with ansible-test --venv option. (#62033) 5 years ago
diff.py Relocate ansible-test code. (#60147) 5 years ago
docker_util.py Relocate ansible-test code. (#60147) 5 years ago
env.py Overhaul ansible-test test path handling. (#61416) 5 years ago
executor.py Update collections integration targets path. (#61523) 5 years ago
git.py [stable-2.9] ansible-test - Continue if the git command returns an error (#61605) 5 years ago
http.py Relocate ansible-test code. (#60147) 5 years ago
import_analysis.py More ansible-test path handling updates. (#61484) 5 years ago
init.py Relocate ansible-test code. (#60147) 5 years ago
manage_ci.py Move ansible-test coverage config to test/lib/ 5 years ago
metadata.py Overhaul ansible-test test path handling. (#61416) 5 years ago
payload.py Support delegation testing collections with deps. 5 years ago
powershell_import_analysis.py Change collection PS util import pattern (#61307) 5 years ago
target.py Update collections integration targets path. (#61523) 5 years ago
test.py Show doc URL for sanity test failures 5 years ago
thread.py Relocate ansible-test code. (#60147) 5 years ago
types.py Overhaul ansible-test test path handling. (#61416) 5 years ago
util.py [stable-2.9] ansible-test - Continue if the git command returns an error (#61605) 5 years ago
util_common.py [stable-2.9] Fix issues with ansible-test --venv option. (#62033) 5 years ago
venv.py [stable-2.9] Work around virtualenv/venv issue in ansible-test. (#62111) 5 years ago