def test_ipy_display_hook__special_repr_raises_exception() -> None:
    """
    When an IPython special repr method raises an exception,
    we treat it as if it doesn't exist and look for the next.
    """
    console = Console(file=io.StringIO(), force_jupyter=True)

    class Thing:
        def _repr_markdown_(self):
            raise Exception()

        def _repr_latex_(self):
            return None

        def _repr_html_(self):
            return "hello"

        def __repr__(self):
            return "therepr"

    result = _ipy_display_hook(Thing(), console=console)
    assert result == "therepr"

    When an IPython special repr method raises an exception,
    we treat it as if it doesn't exist and look for the next.
    
tests/test_pretty.py