mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-30 17:06:19 +00:00
[PR #11048/ebf45260 backport][stable-12] remove conditional code for old snakes (#11050)
remove conditional code for old snakes (#11048)
* remove conditional code for old snakes
* remove conditional code for old snakes
* reformat
* add changelog frag
(cherry picked from commit ebf45260ce)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
16f1d07509
commit
caebf65948
17 changed files with 26 additions and 105 deletions
|
|
@ -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
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue