File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 22from pathlib import Path
33
44from hypothesis import settings
5- from pytest import mark
5+ from pytest import mark , fixture
66
77from array_api_tests import _array_module as xp
88from array_api_tests ._array_module import _UndefinedStub
@@ -126,3 +126,6 @@ def pytest_collection_modifyitems(config, items):
126126 ci_mark = next ((m for m in markers if m .name == "ci" ), None )
127127 if ci_mark is None :
128128 item .add_marker (mark .skip (reason = "disabled via --ci" ))
129+
130+ if config .getoption ('--json-report' ):
131+ fixture (autouse = True )(add_api_name_to_metadata )
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ def pytest_metadata(metadata):
3838 metadata ['array_api_tests_module' ] = xp .mod_name
3939 metadata ['array_api_tests_version' ] = __version__
4040
41- @fixture (autouse = True )
41+ # This is dynamically decorated as a fixture in pytest_collection_modifyitems
42+ # when --json-report is used.
4243def add_api_name_to_metadata (request , json_metadata ):
4344 """
4445 Additional per-test metadata for --json-report
You can’t perform that action at this time.
0 commit comments