MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_raises_bdbquit_with_eoferror

Function test_raises_bdbquit_with_eoferror

testing/test_debugging.py:1281–1297  ·  view source on GitHub ↗

It is not guaranteed that DontReadFromInput's read is called.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

1279
1280
1281def test_raises_bdbquit_with_eoferror(pytester: Pytester) -> None:
1282 """It is not guaranteed that DontReadFromInput's read is called."""
1283
1284 p1 = pytester.makepyfile(
1285 """
1286 def input_without_read(*args, **kwargs):
1287 raise EOFError()
1288
1289 def test(monkeypatch):
1290 import builtins
1291 monkeypatch.setattr(builtins, "input", input_without_read)
1292 __import__('pdb').set_trace()
1293 """
1294 )
1295 result = pytester.runpytest(str(p1))
1296 result.stdout.fnmatch_lines(["E *BdbQuit", "*= 1 failed in*"])
1297 assert result.ret == 1
1298
1299
1300def test_pdb_wrapper_class_is_reused(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected