MCPcopy
hub / github.com/pytest-dev/pytest / test_pdb_print_captured_logs

Method test_pdb_print_captured_logs

testing/test_debugging.py:282–299  ·  testing/test_debugging.py::TestPDB.test_pdb_print_captured_logs
(self, pytester, showcapture: str)

Source from the content-addressed store, hash-verified

280
281 @pytest.mark.parametrize(class="st">"showcapture", [class="st">"all", class="st">"no", class="st">"log"])
282 def test_pdb_print_captured_logs(self, pytester, showcapture: str) -> None:
283 p1 = pytester.makepyfile(
284 class="st">"""
285 def test_1():
286 import logging
287 logging.warning(class="st">"get " + class="st">"rekt")
288 assert False
289 class="st">"""
290 )
291 child = pytester.spawn_pytest(fclass="st">"--show-capture={showcapture} --pdb {p1}")
292 if showcapture in (class="st">"all", class="st">"log"):
293 child.expect(class="st">"captured log")
294 child.expect(class="st">"get rekt")
295 child.expect(class="st">"Pdb")
296 child.sendeof()
297 rest = child.read().decode(class="st">"utf8")
298 assert class="st">"1 failed" in rest
299 self.flush(child)
300
301 def test_pdb_print_captured_logs_nologging(self, pytester: Pytester) -> None:
302 p1 = pytester.makepyfile(

Callers

nothing calls this directly

Calls 4

flushMethod · 0.95
makepyfileMethod · 0.45
spawn_pytestMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected