From 9dfc388645ca17896a069a2e9c506cf057a59f7b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 5 Jun 2026 22:46:48 +0200 Subject: [PATCH 1/3] antsibull-nox: split up unit tests by Python version. --- antsibull-nox.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 04355c5be5..88a8df6fb0 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -117,3 +117,10 @@ include_devel = true [sessions.ansible_test_units] include_devel = true +split_by_python_version = true + +[sessions.ansible_test_units.core_python_versions] +"2.18" = ["3.8", "3.11", "3.13"] +"2.19" = ["3.8", "3.11", "3.13"] +"2.20" = ["3.9", "3.12", "3.14"] +"2.21" = ["3.9", "3.12", "3.14"] From d5ce553f70fbccb708d4f41de85fca15d5fb72f3 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 5 Jun 2026 22:48:20 +0200 Subject: [PATCH 2/3] Adjust syntax for Python-version specific unit tests. --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8575d4717d..710ddc09e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,10 +93,10 @@ The following commands show how to run unit tests: nox -Re ansible-test-units-devel # Run all unit tests for one Python version (a lot faster): -nox -Re ansible-test-units-devel -- --python 3.13 +nox -Re ansible-test-units-devel-3.14 # Run a specific unit test (for the nmcli module) for one Python version: -nox -Re ansible-test-units-devel -- --python 3.13 tests/unit/plugins/modules/net_tools/test_nmcli.py +nox -Re ansible-test-units-devel-3.14 -- tests/unit/plugins/modules/net_tools/test_nmcli.py ``` If you replace `-Re` with `-e`, then the virtual environments will be re-created. The `-R` re-uses them (if they already exist). From 42a619e3ee97d8506a97591f905c5b2f77645776 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 5 Jun 2026 22:49:08 +0200 Subject: [PATCH 3/3] Update Python version in ansible-test example. --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 710ddc09e2..53f8a16cfc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -145,10 +145,10 @@ The following commands show how to run unit tests: ansible-test units --docker -v # Run all unit tests for one Python version (a lot faster): -ansible-test units --docker -v --python 3.8 +ansible-test units --docker -v --python 3.14 # Run a specific unit test (for the nmcli module) for one Python version: -ansible-test units --docker -v --python 3.8 tests/unit/plugins/modules/net_tools/test_nmcli.py +ansible-test units --docker -v --python 3.14 tests/unit/plugins/modules/net_tools/test_nmcli.py ``` ### Integration tests