(
report: CollectReport | TestReport,
)
| 514 | |
| 515 | |
| 516 | def pytest_report_to_serializable( |
| 517 | report: CollectReport | TestReport, |
| 518 | ) -> dict[str, Any] | None: |
| 519 | if isinstance(report, TestReport | CollectReport): |
| 520 | data = report._to_json() |
| 521 | data["$report_type"] = report.__class__.__name__ |
| 522 | return data |
| 523 | # TODO: Check if this is actually reachable. |
| 524 | return None # type: ignore[unreachable] |
| 525 | |
| 526 | |
| 527 | def pytest_report_from_serializable( |