From e550a0f58ff7089dbb6172edaef6394230b6d0dd Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 30 Jul 2025 06:53:42 +0200 Subject: [PATCH] [stable-10] CI: Add Python 3.14 unit tests (#10511) (#10517) * CI: Add Python 3.14 unit tests (#10511) * Add Python 3.14 unit tests. * Skip test if github cannot be imported. It currently cannot be imported because nacl isn't compatible with Python 3.14 yet, and importing github indirectly tries to import nacl, which fails as it uses a type from typing that got removed in 3.14. * Skip test if paramiko cannot be imported. (cherry picked from commit 6ce9f805a8950911f90c7e6d36ef88d4c556ff86) * Skip proxmox connection test if paramiko cannot be imported. --- .azure-pipelines/azure-pipelines.yml | 2 +- tests/unit/plugins/connection/test_proxmox_pct_remote.py | 3 +++ tests/unit/plugins/connection/test_wsl.py | 3 +++ tests/unit/plugins/modules/test_github_repo.py | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 9056c7d5d6..2aa106777b 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -137,7 +137,7 @@ stages: - test: '3.11' - test: '3.12' - test: '3.13' - # - test: '3.14' + - test: '3.14' - stage: Units_2_19 displayName: Units 2.19 dependsOn: [] diff --git a/tests/unit/plugins/connection/test_proxmox_pct_remote.py b/tests/unit/plugins/connection/test_proxmox_pct_remote.py index c0e8678cdc..751bd40da7 100644 --- a/tests/unit/plugins/connection/test_proxmox_pct_remote.py +++ b/tests/unit/plugins/connection/test_proxmox_pct_remote.py @@ -22,6 +22,9 @@ from pathlib import Path from unittest.mock import patch, MagicMock, mock_open +pytest.importorskip('paramiko') + + @pytest.fixture def connection(): play_context = PlayContext() diff --git a/tests/unit/plugins/connection/test_wsl.py b/tests/unit/plugins/connection/test_wsl.py index 8b0d6cdd5b..a714e7cf89 100644 --- a/tests/unit/plugins/connection/test_wsl.py +++ b/tests/unit/plugins/connection/test_wsl.py @@ -20,6 +20,9 @@ from pathlib import Path from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock, mock_open +pytest.importorskip('paramiko') + + @pytest.fixture def connection(): play_context = PlayContext() diff --git a/tests/unit/plugins/modules/test_github_repo.py b/tests/unit/plugins/modules/test_github_repo.py index bbb1f624f4..585b234165 100644 --- a/tests/unit/plugins/modules/test_github_repo.py +++ b/tests/unit/plugins/modules/test_github_repo.py @@ -8,6 +8,7 @@ __metaclass__ = type import re import json import sys +import pytest from httmock import with_httmock, urlmatch, response from ansible_collections.community.internal_test_tools.tests.unit.compat import unittest from ansible_collections.community.general.plugins.modules import github_repo @@ -15,6 +16,9 @@ from ansible_collections.community.general.plugins.modules import github_repo GITHUB_MINIMUM_PYTHON_VERSION = (2, 7) +pytest.importorskip('github') + + @urlmatch(netloc=r'.*') def debug_mock(url, request): print(request.original.__dict__)