1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-03 02:36:55 +00:00

remove conditional code for old snakes (#11048)

* remove conditional code for old snakes

* remove conditional code for old snakes

* reformat

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-11-09 05:21:46 +13:00 committed by GitHub
parent 3478863ef0
commit ebf45260ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 26 additions and 105 deletions

View file

@ -4,7 +4,6 @@
from __future__ import annotations
import sys
import unittest
from httmock import response # noqa
@ -27,22 +26,11 @@ class FakeAnsibleModule:
class GitlabModuleTestCase(unittest.TestCase):
def setUp(self):
unitest_python_version_check_requirement(self)
self.mock_module = FakeAnsibleModule()
self.gitlab_instance = gitlab.Gitlab("http://localhost", private_token="private_token", api_version=4)
# Python 2.7+ is needed for python-gitlab
GITLAB_MINIMUM_PYTHON_VERSION = (2, 7)
# Verify if the current Python version is higher than GITLAB_MINIMUM_PYTHON_VERSION
def python_version_match_requirement():
return sys.version_info >= GITLAB_MINIMUM_PYTHON_VERSION
def python_gitlab_module_version():
return gitlab.__version__
@ -51,14 +39,6 @@ def python_gitlab_version_match_requirement():
return "2.3.0"
# Skip unittest test case if python version don't match requirement
def unitest_python_version_check_requirement(unittest_testcase):
if not python_version_match_requirement():
unittest_testcase.skipTest(
f"Python {'.'.join(map(str, GITLAB_MINIMUM_PYTHON_VERSION))}+ is needed for python-gitlab"
)
"""
USER API
"""