mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 04:34:24 -07:00
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 6ce9f805a8
)
This commit is contained in:
parent
eaa1f7c841
commit
c17bc93996
3 changed files with 8 additions and 1 deletions
|
@ -137,7 +137,7 @@ stages:
|
||||||
- test: '3.11'
|
- test: '3.11'
|
||||||
- test: '3.12'
|
- test: '3.12'
|
||||||
- test: '3.13'
|
- test: '3.13'
|
||||||
# - test: '3.14'
|
- test: '3.14'
|
||||||
- stage: Units_2_19
|
- stage: Units_2_19
|
||||||
displayName: Units 2.19
|
displayName: Units 2.19
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
|
@ -20,6 +20,9 @@ from pathlib import Path
|
||||||
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock, mock_open
|
from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock, mock_open
|
||||||
|
|
||||||
|
|
||||||
|
pytest.importorskip('paramiko')
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def connection():
|
def connection():
|
||||||
play_context = PlayContext()
|
play_context = PlayContext()
|
||||||
|
|
|
@ -8,6 +8,7 @@ __metaclass__ = type
|
||||||
import re
|
import re
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
import pytest
|
||||||
from httmock import with_httmock, urlmatch, response
|
from httmock import with_httmock, urlmatch, response
|
||||||
from ansible_collections.community.internal_test_tools.tests.unit.compat import unittest
|
from ansible_collections.community.internal_test_tools.tests.unit.compat import unittest
|
||||||
from ansible_collections.community.general.plugins.modules import github_repo
|
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)
|
GITHUB_MINIMUM_PYTHON_VERSION = (2, 7)
|
||||||
|
|
||||||
|
|
||||||
|
pytest.importorskip('github')
|
||||||
|
|
||||||
|
|
||||||
@urlmatch(netloc=r'.*')
|
@urlmatch(netloc=r'.*')
|
||||||
def debug_mock(url, request):
|
def debug_mock(url, request):
|
||||||
print(request.original.__dict__)
|
print(request.original.__dict__)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue