def test_brief_error_on_one_fail() -> None:
    """If only one raised and one expected fail to match up, we print a full table iff
    the raised exception would match one of the expected that previously got matched"""
    # no also-matched
    with (
        fails_raises_group(
            "1 matched exception. `TypeError()` is not an instance of `RuntimeError`"
        ),
        RaisesGroup(ValueError, RuntimeError),
    ):
        raise ExceptionGroup("", [ValueError(), TypeError()])

    # raised would match an expected
    with (
        fails_raises_group(
            "\n"
            "1 matched exception. \n"
            "The following expected exceptions did not find a match:\n"
            "  RuntimeError\n"
            "The following raised exceptions did not find a match\n"
            "  TypeError():\n"
            "    It matches `Exception` which was paired with `ValueError()`\n"
            "    `TypeError()` is not an instance of `RuntimeError`"
        ),
        RaisesGroup(Exception, RuntimeError),
    ):
        raise ExceptionGroup("", [ValueError(), TypeError()])

    # expected would match a raised
    with (
        fails_raises_group(
            "\n"
            "1 matched exception. \n"
            "The following expected exceptions did not find a match:\n"
            "  ValueError\n"
            "    It matches `ValueError()` which was paired with `ValueError`\n"
            "The following raised exceptions did not find a match\n"
            "  TypeError():\n"
            "    `TypeError()` is not an instance of `ValueError`"
        ),
        RaisesGroup(ValueError, ValueError),
    ):
        raise ExceptionGroup("", [ValueError(), TypeError()])
If only one raised and one expected fail to match up, we print a full table iff
    the raised exception would match one of the expected that previously got matched
testing/python/raises_group.py