def test_does_not_crash_on_error_from_decorated_function(pytester: Pytester) -> None:
    """Regression test for an issue around bad exception formatting due to
    assertion rewriting mangling lineno's (#4984)."""
    pytester.makepyfile(
        """
        @pytest.fixture
        def a(): return 4
        """
    )
    result = pytester.runpytest()
    # Not INTERNAL_ERROR
    assert result.ret == ExitCode.INTERRUPTED
Regression test for an issue around bad exception formatting due to
    assertion rewriting mangling lineno's (#4984).
testing/test_collection.py