summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2021-12-06 20:27:27 +0100
committerMatt Clay <matt@mystile.com>2021-12-06 23:31:55 +0100
commit33a8d063327f8e3053799c001eaa21b660cb428e (patch)
tree7e4484c61220658abbd091ae182fbc90166af527 /test
parentAdd 'default' to 'env' lookup (#76327) (diff)
downloadansible-33a8d063327f8e3053799c001eaa21b660cb428e.tar.xz
ansible-33a8d063327f8e3053799c001eaa21b660cb428e.zip
ansible-test - Fix import test when vendoring.
Diffstat (limited to 'test')
-rw-r--r--test/lib/ansible_test/_util/target/sanity/import/importer.py6
1 files changed, 6 insertions, 0 deletions
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 c506a9cefb..4708abf153 100644
--- a/test/lib/ansible_test/_util/target/sanity/import/importer.py
+++ b/test/lib/ansible_test/_util/target/sanity/import/importer.py
@@ -475,6 +475,12 @@ 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",