MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_pdb_interaction_on_internal_error

Method test_pdb_interaction_on_internal_error

testing/test_debugging.py:355–379  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

353 self.flush(child)
354
355 def test_pdb_interaction_on_internal_error(self, pytester: Pytester) -> None:
356 pytester.makeconftest(
357 """
358 def pytest_runtest_protocol():
359 0/0
360 """
361 )
362 p1 = pytester.makepyfile("def test_func(): pass")
363 child = pytester.spawn_pytest(f"--pdb {p1}")
364 child.expect("Pdb")
365
366 # INTERNALERROR is only displayed once via terminal reporter.
367 assert (
368 len(
369 [
370 x
371 for x in child.before.decode().splitlines()
372 if x.startswith("INTERNALERROR> Traceback")
373 ]
374 )
375 == 1
376 )
377
378 child.sendeof()
379 self.flush(child)
380
381 def test_pdb_prevent_ConftestImportFailure_hiding_exception(
382 self, pytester: Pytester

Callers

nothing calls this directly

Calls 4

flushMethod · 0.95
makeconftestMethod · 0.45
makepyfileMethod · 0.45
spawn_pytestMethod · 0.45

Tested by

no test coverage detected