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

Method test_pdb_interaction_on_internal_error

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

Source from the content-addressed store, hash-verified

320 self.flush(child)
321
322 def test_pdb_interaction_on_internal_error(self, pytester: Pytester) -> None:
323 pytester.makeconftest(
324 """
325 def pytest_runtest_protocol():
326 0/0
327 """
328 )
329 p1 = pytester.makepyfile("def test_func(): pass")
330 child = pytester.spawn_pytest("--pdb %s" % p1)
331 child.expect("Pdb")
332
333 # INTERNALERROR is only displayed once via terminal reporter.
334 assert (
335 len(
336 [
337 x
338 for x in child.before.decode().splitlines()
339 if x.startswith("INTERNALERROR> Traceback")
340 ]
341 )
342 == 1
343 )
344
345 child.sendeof()
346 self.flush(child)
347
348 def test_pdb_prevent_ConftestImportFailure_hiding_exception(
349 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