Skip to content

Commit 118e528

Browse files
Merge branch 'mark-gpu-tests' into release/0.4.7
2 parents f0c94c3 + a7a7b6f commit 118e528

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xobjects/test_helpers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ def actual_test(*args, **kwargs):
3939
f"this test: {excluding}."
4040
)(actual_test)
4141

42-
return pytest.mark.parametrize(
42+
test = pytest.mark.parametrize(
4343
"test_context",
4444
test_context_names,
4545
)(actual_test)
4646

47+
return pytest.mark.context_dependent(test)
48+
4749

4850
def for_all_test_contexts(*args, **kwargs):
4951
"""Parametrize the decorated test over all test contexts with the argument
@@ -80,7 +82,7 @@ def requires_context(context_name: str):
8082
ctx_names = (type(ctx).__name__ for ctx in get_test_contexts())
8183

8284
if {context_name} & set(ctx_names): # proceed as normal
83-
return lambda test_function: test_function
85+
return pytest.mark.context_dependent
8486

8587
return pytest.mark.skip(f"{context_name} is unavailable on this platform.")
8688

0 commit comments

Comments
 (0)