Skip to content

Commit d02dcb1

Browse files
author
Milind Waykole
committed
feat: add fixture to skip test according to RHOAI csv version
Signed-off-by: Milind Waykole <mwaykole@mwaykole-thinkpadp1gen4i.bengluru.csb>
1 parent 7104caa commit d02dcb1

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

utilities/version_utils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import pytest
2+
from typing import Any
23

34

4-
def skip_if_version_less_than(min_version: str):
5+
def skip_if_version_less_than(min_version: str) -> tuple[Any, ...]:
56
"""
67
Skip tests if version is less than specified minimum.
78
@@ -31,12 +32,15 @@ def skip_if_version_less_than(min_version: str):
3132
pytest.mark.parametrize("skip_if_downstream_version_less_than", [min_version], indirect=True),
3233
pytest.mark.usefixtures("skip_if_downstream_version_less_than"),
3334
)
35+
else:
36+
# For non-downstream distributions, return empty tuple
37+
return ()
3438
except Exception as e:
3539
print(f"⚠️ Version check setup failed: {e}, proceeding with test")
3640
return ()
3741

3842

39-
def skip_if_version_greater_than(max_version: str):
43+
def skip_if_version_greater_than(max_version: str) -> tuple[Any, ...]:
4044
"""
4145
Skip tests if version is greater than specified maximum.
4246
- DOWNSTREAM: Uses RHODS version checking
@@ -64,6 +68,9 @@ def skip_if_version_greater_than(max_version: str):
6468
pytest.mark.parametrize("skip_if_downstream_version_greater_than", [max_version], indirect=True),
6569
pytest.mark.usefixtures("skip_if_downstream_version_greater_than"),
6670
)
71+
else:
72+
# For non-downstream distributions, return empty tuple
73+
return ()
6774
except Exception as e:
6875
print(f"⚠️ Version check setup failed: {e}, proceeding with test")
6976
return ()

0 commit comments

Comments
 (0)