diff --git a/xobjects/test_helpers.py b/xobjects/test_helpers.py index b3bbfad..00d244d 100644 --- a/xobjects/test_helpers.py +++ b/xobjects/test_helpers.py @@ -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 @@ -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.")