2222 Path (os .path .abspath (__file__ )).parent / ".." / ".." / "fixtures" / "integration" / "test_infrahubctl"
2323)
2424
25+ requires_python_310 = pytest .mark .skipif (sys .version_info < (3 , 10 ), reason = "Requires Python 3.10 or higher" )
26+
2527
2628def read_fixture (file_name : str , fixture_subdir : str = "." ) -> str :
2729 """Read the contents of a fixture."""
@@ -57,6 +59,7 @@ class TestInfrahubctlTransform:
5759 """Groups the 'infrahubctl transform' test cases."""
5860
5961 @staticmethod
62+ @requires_python_310
6063 def test_transform_not_exist_in_infrahub_yml (tags_transform_dir : str ) -> None :
6164 """Case transform is not specified in the infrahub.yml file."""
6265 transform_name = "not_existing_transform"
@@ -66,7 +69,7 @@ def test_transform_not_exist_in_infrahub_yml(tags_transform_dir: str) -> None:
6669 assert output .exit_code == 1
6770
6871 @staticmethod
69- @pytest . mark . skipif ( sys . version_info < ( 3 , 10 ), reason = "requires python3.10 or higher" )
72+ @requires_python_310
7073 def test_transform_python_file_not_defined (tags_transform_dir : str ) -> None :
7174 """Case transform python file not defined."""
7275 # Remove transform file
@@ -81,7 +84,7 @@ def test_transform_python_file_not_defined(tags_transform_dir: str) -> None:
8184 assert output .exit_code == 1
8285
8386 @staticmethod
84- @pytest . mark . skipif ( sys . version_info < ( 3 , 10 ), reason = "requires python3.10 or higher" )
87+ @requires_python_310
8588 def test_transform_python_class_not_defined (tags_transform_dir : str ) -> None :
8689 """Case transform python class not defined."""
8790 # Rename transform inside of python file so the class name searched for no longer exists
@@ -101,7 +104,7 @@ def test_transform_python_class_not_defined(tags_transform_dir: str) -> None:
101104 assert output .exit_code == 1
102105
103106 @staticmethod
104- @pytest . mark . skipif ( sys . version_info < ( 3 , 10 ), reason = "requires python3.10 or higher" )
107+ @requires_python_310
105108 def test_gql_query_not_defined (tags_transform_dir : str ) -> None :
106109 """Case GraphQL Query is not defined"""
107110 # Remove GraphQL Query file
@@ -115,7 +118,7 @@ def test_gql_query_not_defined(tags_transform_dir: str) -> None:
115118 assert output .exit_code == 1
116119
117120 @staticmethod
118- @pytest . mark . skipif ( sys . version_info < ( 3 , 10 ), reason = "requires python3.10 or higher" )
121+ @requires_python_310
119122 def test_infrahubctl_transform_cmd_success (httpx_mock : HTTPXMock , tags_transform_dir : str ) -> None :
120123 """Case infrahubctl transform command executes successfully"""
121124 httpx_mock .add_response (
0 commit comments