Skip to content

Commit

Permalink
Add a header to the tests indicating the module and API version
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed May 2, 2024
1 parent e38ce34 commit 8e21362
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@
from array_api_tests import _array_module as xp
from array_api_tests import api_version
from array_api_tests._array_module import _UndefinedStub
from array_api_tests.stubs import EXTENSIONS
from array_api_tests import xp_name

from reporting import pytest_metadata, pytest_json_modifyreport, add_extra_json_metadata # noqa

def pytest_report_header(config):
disabled_extensions = config.getoption("--disable-extension")
enabled_extensions = sorted({
ext for ext in EXTENSIONS + ['fft'] if ext not in disabled_extensions and xp_has_ext(ext)
})

return f"Array API Tests Module: {xp_name}. API Version: {api_version}. Enabled Extensions: {', '.join(enabled_extensions)}"

def pytest_addoption(parser):
# Hypothesis max examples
Expand Down

0 comments on commit 8e21362

Please sign in to comment.