Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions xobjects/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ def actual_test(*args, **kwargs):
f"this test: {excluding}."
)(actual_test)

return pytest.mark.parametrize(
test = pytest.mark.parametrize(
"test_context",
test_context_names,
)(actual_test)

return pytest.mark.context_dependent(test)


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

if {context_name} & set(ctx_names): # proceed as normal
return lambda test_function: test_function
return pytest.mark.context_dependent

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

Expand Down