remove unnecessary checks for unsupported python versions (#10327)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.16) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.11) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.16+py3.6) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+fedora38+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.16+opensuse15+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run

This commit is contained in:
Alexei Znamensky 2025-07-02 10:23:58 +12:00 committed by GitHub
commit 5a5b2d2eed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 2 additions and 21 deletions

View file

@ -7,14 +7,8 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type __metaclass__ = type
import pytest import pytest
import sys
linode_apiv4 = pytest.importorskip('linode_api4') linode_apiv4 = pytest.importorskip('linode_api4')
mandatory_py_version = pytest.mark.skipif(
sys.version_info < (2, 7),
reason='The linode_api4 dependency requires python2.7 or higher'
)
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.parsing.dataloader import DataLoader from ansible.parsing.dataloader import DataLoader

View file

@ -7,13 +7,10 @@ __metaclass__ = type
import re import re
import json import json
import sys
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
GITHUB_MINIMUM_PYTHON_VERSION = (2, 7)
@urlmatch(netloc=r'.*') @urlmatch(netloc=r'.*')
def debug_mock(url, request): def debug_mock(url, request):
@ -167,11 +164,6 @@ def delete_repo_notfound_mock(url, request):
class TestGithubRepo(unittest.TestCase): class TestGithubRepo(unittest.TestCase):
def setUp(self):
if sys.version_info < GITHUB_MINIMUM_PYTHON_VERSION:
self.skipTest("Python %s+ is needed for PyGithub" %
",".join(map(str, GITHUB_MINIMUM_PYTHON_VERSION)))
@with_httmock(get_orgs_mock) @with_httmock(get_orgs_mock)
@with_httmock(get_repo_notfound_mock) @with_httmock(get_repo_notfound_mock)
@with_httmock(create_new_org_repo_mock) @with_httmock(create_new_org_repo_mock)

View file

@ -7,15 +7,10 @@ __metaclass__ = type
import json import json
import os import os
import sys
import pytest import pytest
linode_apiv4 = pytest.importorskip('linode_api4') linode_apiv4 = pytest.importorskip('linode_api4')
mandatory_py_version = pytest.mark.skipif(
sys.version_info < (2, 7),
reason='The linode_api4 dependency requires python2.7 or higher'
)
from linode_api4.errors import ApiError as LinodeApiError from linode_api4.errors import ApiError as LinodeApiError
from linode_api4 import LinodeClient from linode_api4 import LinodeClient

View file

@ -147,7 +147,7 @@ class TestUnloadModule(ModuleTestCase):
class TestModuleIsLoadedPersistently(ModuleTestCase): class TestModuleIsLoadedPersistently(ModuleTestCase):
def setUp(self): def setUp(self):
if (sys.version_info[0] == 3 and sys.version_info[1] < 7) or (sys.version_info[0] == 2 and sys.version_info[1] < 7): if sys.version_info[0] == 3 and sys.version_info[1] < 7:
self.skipTest("open_mock doesn't support readline in earlier python versions") self.skipTest("open_mock doesn't support readline in earlier python versions")
super(TestModuleIsLoadedPersistently, self).setUp() super(TestModuleIsLoadedPersistently, self).setUp()
@ -222,7 +222,7 @@ class TestModuleIsLoadedPersistently(ModuleTestCase):
class TestPermanentParams(ModuleTestCase): class TestPermanentParams(ModuleTestCase):
def setUp(self): def setUp(self):
if (sys.version_info[0] == 3 and sys.version_info[1] < 7) or (sys.version_info[0] == 2 and sys.version_info[1] < 7): if sys.version_info[0] == 3 and sys.version_info[1] < 7:
self.skipTest("open_mock doesn't support readline in earlier python versions") self.skipTest("open_mock doesn't support readline in earlier python versions")
super(TestPermanentParams, self).setUp() super(TestPermanentParams, self).setUp()