File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
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
@@ -132,3 +132,16 @@ def pytest_metadata(metadata):
132132 Additional metadata for --json-report.
133133 """
134134 metadata ['array_api_tests_module' ] = xp .mod_name
135+
136+ @fixture (autouse = True )
137+ def add_api_name_to_metadata (request , json_metadata ):
138+ test_module = request .module .__name__
139+ test_function = request .function .__name__
140+ assert test_function .startswith ('test_' ), 'unexpected test function name'
141+
142+ if test_module == 'array_api_tests.test_has_names' :
143+ array_api_function_name = None
144+ else :
145+ array_api_function_name = test_function [len ('test_' ):]
146+
147+ json_metadata ['array_api_function_name' ] = array_api_function_name
You can’t perform that action at this time.
0 commit comments