From 97ef1d031c77d19525e87c4b4830905962cacc80 Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Tue, 7 Dec 2021 09:41:54 -0800 Subject: [PATCH] Revert "ansible-test - Fix import test when vendoring." This reverts commit 33a8d063327f8e3053799c001eaa21b660cb428e. --- changelogs/fragments/ansible-test-sanity-vendoring.yml | 2 -- lib/ansible/_vendor/__init__.py | 1 - .../lib/ansible_test/_util/target/sanity/import/importer.py | 6 ------ 3 files changed, 9 deletions(-) delete mode 100644 changelogs/fragments/ansible-test-sanity-vendoring.yml diff --git a/changelogs/fragments/ansible-test-sanity-vendoring.yml b/changelogs/fragments/ansible-test-sanity-vendoring.yml deleted file mode 100644 index 7b6803da904..00000000000 --- a/changelogs/fragments/ansible-test-sanity-vendoring.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - ansible-test - Fix the ``import`` sanity test to work properly when Ansible's built-in vendoring support is in use. diff --git a/lib/ansible/_vendor/__init__.py b/lib/ansible/_vendor/__init__.py index 21f3efedf97..a31957b6724 100644 --- a/lib/ansible/_vendor/__init__.py +++ b/lib/ansible/_vendor/__init__.py @@ -39,7 +39,6 @@ def _ensure_vendored_path_entry(): already_loaded_vendored_modules = set(sys.modules.keys()).intersection(vendored_module_names) if already_loaded_vendored_modules: - # NOTE: If this message is changed, the matching warning filter in ansible-test must also be updated in `importer.py` for the import sanity test. warnings.warn('One or more Python packages bundled by this ansible-core distribution were already ' 'loaded ({0}). This may result in undefined behavior.'.format(', '.join(sorted(already_loaded_vendored_modules)))) diff --git a/test/lib/ansible_test/_util/target/sanity/import/importer.py b/test/lib/ansible_test/_util/target/sanity/import/importer.py index 4708abf1533..c506a9cefb1 100644 --- a/test/lib/ansible_test/_util/target/sanity/import/importer.py +++ b/test/lib/ansible_test/_util/target/sanity/import/importer.py @@ -475,12 +475,6 @@ def main(): with warnings.catch_warnings(): warnings.simplefilter('error') - # If vendoring is in use (lib/ansible/_vendor/), then vendored modules may already be loaded after the first file is tested. - # To avoid test failures, the warning about this condition must be ignored. - warnings.filterwarnings( - "ignore", - "One or more Python packages bundled by this ansible-core distribution were already loaded ") - if sys.version_info[0] == 2: warnings.filterwarnings( "ignore",