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

Method test_pdb_unittest_postmortem

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

Source from the content-addressed store, hash-verified

164 assert not child.isalive()
165
166 def test_pdb_unittest_postmortem(self, pytester: Pytester) -> None:
167 p1 = pytester.makepyfile(
168 """
169 import unittest
170 class Blub(unittest.TestCase):
171 def tearDown(self):
172 self.filename = None
173 def test_false(self):
174 self.filename = 'debug' + '.me'
175 assert 0
176 """
177 )
178 child = pytester.spawn_pytest(f"--pdb {p1}")
179 child.expect("Pdb")
180 child.sendline("p self.filename")
181 child.sendeof()
182 rest = child.read().decode("utf8")
183 assert "debug.me" in rest
184 self.flush(child)
185
186 def test_pdb_unittest_skip(self, pytester: Pytester) -> None:
187 """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