def test_deserialization_failure(self, pytester: Pytester) -> None:
        """Check handling of failure during deserialization of report types."""
        pytester.makepyfile(
            """
            def test_a():
                assert False
        """
        )
        reprec = pytester.inline_run()
        reports = reprec.getreports("pytest_runtest_logreport")
        assert len(reports) == 3
        test_a_call = reports[1]
        data = test_a_call._to_json()
        entry = data["longrepr"]["reprtraceback"]["reprentries"][0]
        assert entry["type"] == "ReprEntry"

        entry["type"] = "Unknown"
        with pytest.raises(
            RuntimeError, match="INTERNALERROR: Unknown entry type returned: Unknown"
        ):
            TestReport._from_json(data)
Check handling of failure during deserialization of report types.
testing/test_reports.py