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

Method test_pdb_unittest_postmortem

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

Source from the content-addressed store, hash-verified

196 assert not child.isalive()
197
198 def test_pdb_unittest_postmortem(self, pytester: Pytester) -> None:
199 p1 = pytester.makepyfile(
200 """
201 import unittest
202 class Blub(unittest.TestCase):
203 def tearDown(self):
204 self.filename = None
205 def test_false(self):
206 self.filename = 'debug' + '.me'
207 assert 0
208 """
209 )
210 child = pytester.spawn_pytest(f"--pdb {p1}")
211 child.expect("Pdb")
212 child.sendline("p self.filename")
213 child.sendeof()
214 rest = child.read().decode("utf8")
215 assert "debug.me" in rest
216 self.flush(child)
217
218 def test_pdb_unittest_skip(self, pytester: Pytester) -> None:
219 """Test for issue #2137"""

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