Skip to content

Commit

Permalink
Merge pull request #258 from asmeurer/header
Browse files Browse the repository at this point in the history
Add a header to the tests indicating the module and API version
  • Loading branch information
honno committed May 2, 2024
2 parents e38ce34 + 8e21362 commit e1fe6fb
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 e1fe6fb

Please sign in to comment.