@@ -334,8 +334,20 @@ def pytest_runtest_protocol():
334334 )
335335 p1 = testdir .makepyfile ("def test_func(): pass" )
336336 child = testdir .spawn_pytest ("--pdb %s" % p1 )
337- # child.expect(".*import pytest.*")
338337 child .expect ("Pdb" )
338+
339+ # INTERNALERROR is only displayed once via terminal reporter.
340+ assert (
341+ len (
342+ [
343+ x
344+ for x in child .before .decode ().splitlines ()
345+ if x .startswith ("INTERNALERROR> Traceback" )
346+ ]
347+ )
348+ == 1
349+ )
350+
339351 child .sendeof ()
340352 self .flush (child )
341353
@@ -345,7 +357,7 @@ def test_pdb_interaction_capturing_simple(self, testdir):
345357 import pytest
346358 def test_1():
347359 i = 0
348- print ("hello17")
360+ print("hello17")
349361 pytest.set_trace()
350362 x = 3
351363 """
@@ -383,7 +395,7 @@ def test_pdb_and_capsys(self, testdir):
383395 """
384396 import pytest
385397 def test_1(capsys):
386- print ("hello1")
398+ print("hello1")
387399 pytest.set_trace()
388400 """
389401 )
@@ -420,7 +432,7 @@ def test_set_trace_capturing_afterwards(self, testdir):
420432 def test_1():
421433 pdb.set_trace()
422434 def test_2():
423- print ("hello")
435+ print("hello")
424436 assert 0
425437 """
426438 )
@@ -461,10 +473,10 @@ def test_pdb_interaction_capturing_twice(self, testdir):
461473 import pytest
462474 def test_1():
463475 i = 0
464- print ("hello17")
476+ print("hello17")
465477 pytest.set_trace()
466478 x = 3
467- print ("hello18")
479+ print("hello18")
468480 pytest.set_trace()
469481 x = 4
470482 """
@@ -525,7 +537,7 @@ def test_enter_pdb_hook_is_called(self, testdir):
525537 """
526538 def pytest_enter_pdb(config):
527539 assert config.testing_verification == 'configured'
528- print 'enter_pdb_hook'
540+ print( 'enter_pdb_hook')
529541
530542 def pytest_configure(config):
531543 config.testing_verification = 'configured'
@@ -562,7 +574,7 @@ def test_pdb_custom_cls_with_settrace(self, testdir, monkeypatch):
562574 custom_pdb = """
563575 class CustomPdb(object):
564576 def set_trace(*args, **kwargs):
565- print 'custom set_trace>'
577+ print( 'custom set_trace>')
566578 """
567579 )
568580 p1 = testdir .makepyfile (
0 commit comments