From 68d6f8b96e6b0ed9f5d1f7c42e7ff6480c2adb04 Mon Sep 17 00:00:00 2001 From: Rakesh S Date: Thu, 16 Jul 2026 17:38:39 +0530 Subject: [PATCH 1/3] fix: resolve SonarCloud quality gate violations - Add placeholder test to empty test file (S2187) - Separate host lookup from exception assertion so only one invocation can throw inside pytest.raises block (S5778) --- .../test/test/tests/unit/plugins/modules/test_pool.py | 5 +++++ tests/test_module_dispatcher.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py b/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py index bfcee496..dee1979b 100644 --- a/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py +++ b/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py @@ -1 +1,6 @@ """Sample test file.""" +from __future__ import annotations + + +def test_placeholder() -> None: + """Placeholder to satisfy test-file detection.""" diff --git a/tests/test_module_dispatcher.py b/tests/test_module_dispatcher.py index 60fc72ba..39b89b2a 100644 --- a/tests/test_module_dispatcher.py +++ b/tests/test_module_dispatcher.py @@ -67,8 +67,9 @@ def test_ansible_module_error(hosts): # type: ignore[no-untyped-def] # noqa: A """Verify that AnsibleModuleError is raised when no such module exists.""" from pytest_ansible.errors import AnsibleModuleError + all_hosts = hosts().all with pytest.raises(AnsibleModuleError) as exc_info: - hosts().all.a_module_that_most_certainly_does_not_exist() + all_hosts.a_module_that_most_certainly_does_not_exist() assert ( str(exc_info.value) == f"The module {'a_module_that_most_certainly_does_not_exist'} was not found in configured module paths." # noqa: E501 From 2c81cfe21bdd442adada14a712973c79ec6432a0 Mon Sep 17 00:00:00 2001 From: Rakesh S Date: Thu, 16 Jul 2026 17:44:41 +0530 Subject: [PATCH 2/3] fix: apply ruff formatting to test fixture --- .../test/test/tests/unit/plugins/modules/test_pool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py b/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py index dee1979b..079295cb 100644 --- a/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py +++ b/tests/fixtures/ansible_collections/test/test/tests/unit/plugins/modules/test_pool.py @@ -1,4 +1,5 @@ """Sample test file.""" + from __future__ import annotations From b730d3f5dfe381215ee51db8725ea270ea0b1f85 Mon Sep 17 00:00:00 2001 From: Rakesh S Date: Thu, 16 Jul 2026 18:30:38 +0530 Subject: [PATCH 3/3] fix(docs): remove mkdocstrings plugin to unblock docs CI The mkdocstrings plugin fetches objects.inv from docs.ansible.com which intermittently returns HTTP 429 (Too Many Requests), causing docs builds to fail in strict mode. The plugin was configured but never used as no ::: autodoc directives exist in the docs. Same fix as ansible-lint#5084. --- mkdocs.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/mkdocs.yml b/mkdocs.yml index f9375842..7f894fad 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,19 +32,6 @@ plugins: - material/search: separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])' - material/tags - - mkdocstrings: - handlers: - python: - paths: [src] - options: - # Sphinx is for historical reasons, but we could consider switching if needed - # https://mkdocstrings.github.io/griffe/docstrings/ - docstring_style: sphinx - merge_init_into_class: yes - show_submodules: yes - inventories: - - url: https://docs.ansible.com/ansible/latest/objects.inv - domains: [py, std] markdown_extensions: - markdown_include.include: