Skip to content

Commit f5da549

Browse files
committed
remove conditional code for old snakes
1 parent 4c06740 commit f5da549

File tree

7 files changed

+8
-22
lines changed

7 files changed

+8
-22
lines changed

tests/unit/plugins/modules/test_gitlab_deploy_key.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ def _dummy(x):
1919
try:
2020
from .gitlab import (
2121
GitlabModuleTestCase,
22-
python_version_match_requirement,
2322
resp_get_project,
2423
resp_find_project_deploy_key,
2524
resp_create_project_deploy_key,
2625
resp_delete_project_deploy_key,
2726
)
2827

2928
# GitLab module requirements
30-
if python_version_match_requirement():
31-
from gitlab.v4.objects import ProjectKey
29+
from gitlab.v4.objects import ProjectKey
3230
except ImportError:
3331
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
3432
# Need to set these to something so that we don't fail when parsing

tests/unit/plugins/modules/test_gitlab_group.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def _dummy(x):
1919
try:
2020
from .gitlab import (
2121
GitlabModuleTestCase,
22-
python_version_match_requirement,
2322
resp_get_group,
2423
resp_get_missing_group,
2524
resp_create_group,
@@ -29,8 +28,7 @@ def _dummy(x):
2928
)
3029

3130
# GitLab module requirements
32-
if python_version_match_requirement():
33-
from gitlab.v4.objects import Group
31+
from gitlab.v4.objects import Group
3432
except ImportError:
3533
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
3634
# Need to set these to something so that we don't fail when parsing

tests/unit/plugins/modules/test_gitlab_hook.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ def _dummy(x):
1919
try:
2020
from .gitlab import (
2121
GitlabModuleTestCase,
22-
python_version_match_requirement,
2322
resp_get_project,
2423
resp_find_project_hook,
2524
resp_create_project_hook,
2625
resp_delete_project_hook,
2726
)
2827

2928
# GitLab module requirements
30-
if python_version_match_requirement():
31-
from gitlab.v4.objects import ProjectHook
29+
from gitlab.v4.objects import ProjectHook
3230
except ImportError:
3331
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
3432
# Need to set these to something so that we don't fail when parsing

tests/unit/plugins/modules/test_gitlab_project.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def _dummy(x):
1919
try:
2020
from .gitlab import (
2121
GitlabModuleTestCase,
22-
python_version_match_requirement,
2322
resp_get_group,
2423
resp_get_project_by_name,
2524
resp_create_project,
@@ -29,8 +28,7 @@ def _dummy(x):
2928
)
3029

3130
# GitLab module requirements
32-
if python_version_match_requirement():
33-
from gitlab.v4.objects import Project
31+
from gitlab.v4.objects import Project
3432
except ImportError:
3533
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
3634
# Need to set these to something so that we don't fail when parsing

tests/unit/plugins/modules/test_gitlab_protected_branch.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def _dummy(x):
2121
try:
2222
from .gitlab import (
2323
GitlabModuleTestCase,
24-
python_version_match_requirement,
2524
python_gitlab_module_version,
2625
python_gitlab_version_match_requirement,
2726
resp_get_protected_branch,
@@ -32,12 +31,11 @@ def _dummy(x):
3231
)
3332

3433
# GitLab module requirements
35-
if python_version_match_requirement():
36-
from gitlab.v4.objects import Project # noqa: F401, pylint: disable=unused-import
34+
from gitlab.v4.objects import Project # noqa: F401, pylint: disable=unused-import
3735
gitlab_req_version = python_gitlab_version_match_requirement()
3836
gitlab_module_version = python_gitlab_module_version()
3937
if LooseVersion(gitlab_module_version) < LooseVersion(gitlab_req_version):
40-
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing (Wrong version)"))
38+
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing (Wrong version)"))
4139
except ImportError:
4240
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
4341

tests/unit/plugins/modules/test_gitlab_runner.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def _dummy(x):
2222
from .gitlab import (
2323
FakeAnsibleModule,
2424
GitlabModuleTestCase,
25-
python_version_match_requirement,
2625
resp_find_runners_all,
2726
resp_find_runners_list,
2827
resp_find_project_runners,
@@ -35,8 +34,7 @@ def _dummy(x):
3534
)
3635

3736
# GitLab module requirements
38-
if python_version_match_requirement():
39-
from gitlab.v4.objects import Runner
37+
from gitlab.v4.objects import Runner
4038
except ImportError:
4139
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
4240
# Need to set these to something so that we don't fail when parsing

tests/unit/plugins/modules/test_gitlab_user.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ def _dummy(x):
1919
try:
2020
from .gitlab import (
2121
GitlabModuleTestCase,
22-
python_version_match_requirement,
2322
resp_find_user,
2423
resp_get_user,
2524
resp_get_user_keys,
@@ -34,8 +33,7 @@ def _dummy(x):
3433
)
3534

3635
# GitLab module requirements
37-
if python_version_match_requirement():
38-
from gitlab.v4.objects import User
36+
from gitlab.v4.objects import User
3937
except ImportError:
4038
pytestmark.append(pytest.mark.skip("Could not load gitlab module required for testing"))
4139
# Need to set these to something so that we don't fail when parsing

0 commit comments

Comments
 (0)