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 2
2
from pathlib import Path
3
3
4
4
from hypothesis import settings
5
- from pytest import mark
5
+ from pytest import mark , fixture
6
6
7
7
from array_api_tests import _array_module as xp
8
8
from array_api_tests ._array_module import _UndefinedStub
@@ -132,3 +132,16 @@ def pytest_metadata(metadata):
132
132
Additional metadata for --json-report.
133
133
"""
134
134
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