@@ -1486,12 +1486,26 @@ def test_relative_imports_on_plain_module(self):
14861486 stdout , _ = self ._run_pdb (['-m' , self .module_name + '.runme' ], commands )
14871487 self .assertTrue (any ("VAR from module" in l for l in stdout .splitlines ()), stdout )
14881488
1489- def test_syntaxerror_in_command (self ):
1490- commands = "print(\n debug print("
1491- stdout , _ = self .run_pdb_script ("" , commands )
1489+ def test_errors_in_command (self ):
1490+ commands = "\n " .join ([
1491+ 'print(' ,
1492+ 'debug print(' ,
1493+ 'debug doesnotexist' ,
1494+ 'c' ,
1495+ ])
1496+ stdout , _ = self .run_pdb_script ('' , commands + '\n ' )
1497+
14921498 self .assertEqual (stdout .splitlines ()[1 :], [
14931499 '(Pdb) *** SyntaxError: unexpected EOF while parsing' ,
1494- '(Pdb) *** SyntaxError: unexpected EOF while parsing' ,
1500+
1501+ '(Pdb) ENTERING RECURSIVE DEBUGGER' ,
1502+ '*** SyntaxError: unexpected EOF while parsing' ,
1503+ 'LEAVING RECURSIVE DEBUGGER' ,
1504+
1505+ '(Pdb) ENTERING RECURSIVE DEBUGGER' ,
1506+ '> <string>(1)<module>()' ,
1507+ "((Pdb)) *** NameError: name 'doesnotexist' is not defined" ,
1508+ 'LEAVING RECURSIVE DEBUGGER' ,
14951509 '(Pdb) ' ,
14961510 ])
14971511
0 commit comments