@@ -46,35 +46,51 @@ def pytest_addoption(parser: Parser) -> None:
46
46
"""
47
47
48
48
parser .addoption (
49
- "--4C_ArborX " ,
49
+ "--4C " ,
50
50
action = "store_true" ,
51
51
default = False ,
52
- help = "Execute 4C and ArborX based tests." ,
52
+ help = "Execute standard and 4C based tests." ,
53
+ )
54
+
55
+ parser .addoption (
56
+ "--ArborX" ,
57
+ action = "store_true" ,
58
+ default = False ,
59
+ help = "Execute standard and ArborX based tests." ,
53
60
)
54
61
55
62
parser .addoption (
56
63
"--CubitPy" ,
57
64
action = "store_true" ,
58
65
default = False ,
59
- help = "Execute CubitPy based tests." ,
66
+ help = "Execute standard and CubitPy based tests." ,
67
+ )
68
+
69
+ parser .addoption (
70
+ "--Performance" ,
71
+ action = "store_true" ,
72
+ default = False ,
73
+ help = "Execute standard and performance tests." ,
60
74
)
61
75
62
76
parser .addoption (
63
- "--performance " ,
77
+ "--exclude-standard-tests " ,
64
78
action = "store_true" ,
65
79
default = False ,
66
- help = "Execute performance tests." ,
80
+ help = "Exclude standard tests." ,
67
81
)
68
82
69
83
70
84
def pytest_collection_modifyitems (config : Config , items : list ) -> None :
71
85
"""Filter tests based on their markers and provided command line options.
72
86
73
87
Currently configured options:
74
- `pytest`: execute tests with no markers
75
- `pytest --4C_ArborX`: execute tests with the `fourc_arborx` marker
76
- `pytest --CubitPy`: execute tests with the `cubitpy` marker
77
- `pytest --performance`: execute tests with the `performance` marker
88
+ `pytest`: Execute standard tests with no markers
89
+ `pytest --4C`: Execute standard tests and tests with the `fourc` marker
90
+ `pytest --ArborX`: Execute standard tests and tests with the `arborx` marker
91
+ `pytest --CubitPy`: Execute standard tests and tests with the `cubitpy` marker
92
+ `pytest --Performance`: Execute standard tests and tests with the `performance` marker
93
+ `pytest --exclude-standard-tests`: Execute tests with any other marker and exclude the standard unmarked tests
78
94
79
95
Args:
80
96
config: Pytest config
@@ -88,16 +104,19 @@ def pytest_collection_modifyitems(config: Config, items: list) -> None:
88
104
# Get all set markers for current test (e.g. `fourc_arborx`, `cubitpy`, `performance`)
89
105
markers = [marker .name for marker in item .iter_markers ()]
90
106
91
- if config .getoption ("--4C_ArborX" ) and "fourc_arborx" in markers :
107
+ if config .getoption ("--4C" ) and "fourc" in markers :
108
+ selected_tests .append (item )
109
+
110
+ if config .getoption ("--ArborX" ) and "arborx" in markers :
92
111
selected_tests .append (item )
93
112
94
113
if config .getoption ("--CubitPy" ) and "cubitpy" in markers :
95
114
selected_tests .append (item )
96
115
97
- if config .getoption ("--performance " ) and "performance" in markers :
116
+ if config .getoption ("--Performance " ) and "performance" in markers :
98
117
selected_tests .append (item )
99
118
100
- if not markers :
119
+ if not markers and not config . getoption ( "--exclude-standard-tests" ) :
101
120
selected_tests .append (item )
102
121
103
122
deselected_tests = list (set (items ) - set (selected_tests ))
@@ -133,5 +152,5 @@ def current_test_name(request: pytest.FixtureRequest) -> str:
133
152
134
153
135
154
@pytest .fixture
136
- def compare_result_file (reference , result , rtol , atol ):
155
+ def compare_results (reference , result , rtol , atol ):
137
156
raise NotImplementedError
0 commit comments