diff options
author | Matt Davis <nitzmahone@users.noreply.github.com> | 2020-05-26 09:42:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 09:42:06 -0700 |
commit | f7dfa817ae6542509e0c6eb437ea7bcc51242ca2 (patch) | |
tree | 54279745ec63a4da6de54a59a18041d6de76b072 /test/lib/ansible_test/_data/pytest | |
parent | fdfa6fec75da14d7e145eccf7c092fba684ee1e2 (diff) | |
download | ansible-f7dfa817ae6542509e0c6eb437ea7bcc51242ca2.tar.gz |
collection routing (#67684)
* `meta/` directory in collections
* runtime metadata for redirection/deprecation/removal of plugin loads
* a compatibility layer to keep existing content working on ansible-base + collections
* a Python import redirection layer to keep collections-hosted (and otherwise moved) content importable by things that don't know better
* supported Ansible version validation on collection loads
Diffstat (limited to 'test/lib/ansible_test/_data/pytest')
-rw-r--r-- | test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_collections.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_collections.py b/test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_collections.py index 91e2047878..906fdc7c70 100644 --- a/test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_collections.py +++ b/test/lib/ansible_test/_data/pytest/plugins/ansible_pytest_collections.py @@ -26,10 +26,11 @@ def pytest_configure(): except AttributeError: pytest_configure.executed = True - from ansible.utils.collection_loader import AnsibleCollectionLoader + from ansible.utils.collection_loader._collection_finder import _AnsibleCollectionFinder # allow unit tests to import code from collections - sys.meta_path.insert(0, AnsibleCollectionLoader()) + + _AnsibleCollectionFinder(paths=[os.path.dirname(ANSIBLE_COLLECTIONS_PATH)])._install() # pylint: disable=protected-access # noinspection PyProtectedMember import py._path.local |