rocm_jax/tests/conftest.py
charleshofer 022da913e6
Count test totals correctly for dashboards (#280)
* Account test totals correctly for dashboards

* Add blurb to the dev guide on skipping tests

* Remove extra newline

* Default to 0 if "skipped" isn't found

Co-authored-by: Mathew Odden <1471252+mrodden@users.noreply.github.com>

---------

Co-authored-by: Mathew Odden <1471252+mrodden@users.noreply.github.com>
2025-03-14 16:57:08 -05:00

15 lines
540 B
Python

import os
import pytest
INCLUDE_SKIPS = os.getenv("ROCM_TEST_INCLUDE_SKIPS", default=False)
@pytest.hookimpl(optionalhook=True)
def pytest_json_modifyreport(json_report):
"""Get rid of skipped tests in reporting. We only care about xfails."""
if (not INCLUDE_SKIPS
and "summary" in json_report
and "total" in json_report["summary"]):
json_report["summary"]["unskipped_total"] = json_report["summary"]["total"] - json_report["summary"].get("skipped", 0)
del json_report["summary"]["total"]