File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4342,6 +4342,32 @@ def test_quit(self):
4342
4342
# The quit prompt should be printed exactly twice
4343
4343
self .assertEqual (stdout .count ("Quit anyway" ), 2 )
4344
4344
4345
+ def test_quit_after_interact (self ):
4346
+ """
4347
+ interact command will set sys.ps1 temporarily, we need to make sure
4348
+ that it's restored and pdb does not believe it's in interactive mode
4349
+ after interact is done.
4350
+ """
4351
+ script = """
4352
+ x = 1
4353
+ breakpoint()
4354
+ """
4355
+
4356
+ commands = """
4357
+ interact
4358
+ quit()
4359
+ q
4360
+ y
4361
+ """
4362
+
4363
+ stdout , stderr = self ._run_script (script , commands )
4364
+ # Normal exit should not print anything to stderr
4365
+ self .assertEqual (stderr , "" )
4366
+ # The quit prompt should be printed exactly once
4367
+ self .assertEqual (stdout .count ("Quit anyway" ), 1 )
4368
+ # BdbQuit should not be printed
4369
+ self .assertNotIn ("BdbQuit" , stdout )
4370
+
4345
4371
def test_set_trace_with_skip (self ):
4346
4372
"""GH-82897
4347
4373
Inline set_trace() should break unconditionally. This example is a
You can’t perform that action at this time.
0 commit comments