Skip to content

Commit e1fe6fb

Browse files
authored
Merge pull request #258 from asmeurer/header
Add a header to the tests indicating the module and API version
2 parents e38ce34 + 8e21362 commit e1fe6fb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: conftest.py

+9
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,18 @@
1212
from array_api_tests import _array_module as xp
1313
from array_api_tests import api_version
1414
from array_api_tests._array_module import _UndefinedStub
15+
from array_api_tests.stubs import EXTENSIONS
16+
from array_api_tests import xp_name
1517

1618
from reporting import pytest_metadata, pytest_json_modifyreport, add_extra_json_metadata # noqa
1719

20+
def pytest_report_header(config):
21+
disabled_extensions = config.getoption("--disable-extension")
22+
enabled_extensions = sorted({
23+
ext for ext in EXTENSIONS + ['fft'] if ext not in disabled_extensions and xp_has_ext(ext)
24+
})
25+
26+
return f"Array API Tests Module: {xp_name}. API Version: {api_version}. Enabled Extensions: {', '.join(enabled_extensions)}"
1827

1928
def pytest_addoption(parser):
2029
# Hypothesis max examples

0 commit comments

Comments
 (0)