make "import pdb ; pdb.set_trace()" work natively wrt capturing (no "-s" needed

anymore), turning ``pytest.set_trace()`` into a mere shortcut.
This commit is contained in:
holger krekel
2013-09-06 15:29:00 +02:00
parent 109e2f215f
commit c478027805
3 changed files with 25 additions and 0 deletions

View File

@@ -134,6 +134,22 @@ class TestPDB:
if child.isalive():
child.wait()
def test_pdb_set_trace_interception(self, testdir):
p1 = testdir.makepyfile("""
import pdb
def test_1():
pdb.set_trace()
""")
child = testdir.spawn_pytest(str(p1))
child.expect("test_1")
child.expect("(Pdb)")
child.sendeof()
rest = child.read()
assert "1 failed" in rest
assert "reading from stdin while output" not in rest
if child.isalive():
child.wait()
def test_pdb_and_capsys(self, testdir):
p1 = testdir.makepyfile("""
import pytest