def test_raises_bdbquit_with_eoferror(pytester: Pytester) -> None:
    """It is not guaranteed that DontReadFromInput's read is called."""
    p1 = pytester.makepyfile(
        """
        def input_without_read(*args, **kwargs):
            raise EOFError()

        def test(monkeypatch):
            import builtins
            monkeypatch.setattr(builtins, "input", input_without_read)
            __import__('pdb').set_trace()
        """
    )
    result = pytester.runpytest(str(p1))
    result.assert_outcomes(failed=1)
    result.stdout.fnmatch_lines(["E *BdbQuit", "*= 1 failed in*"])
    assert result.ret == 1
It is not guaranteed that DontReadFromInput's read is called.
testing/test_debugging.py