def test_crash_during_shutdown_captured(pytester: Pytester) -> None:
    """
    Re-enable faulthandler if pytest encountered it enabled during configure.
    We should be able to then see crashes during interpreter shutdown.
    """
    setup_crashing_test(pytester)
    args = (sys.executable, "-Xfaulthandler", "-mpytest")
    result = pytester.run(*args)
    result.stderr.fnmatch_lines(["*Fatal Python error*"])
    assert result.ret != 0

    Re-enable faulthandler if pytest encountered it enabled during configure.
    We should be able to then see crashes during interpreter shutdown.
    
testing/test_faulthandler.py