stop test session on BdbQuit from pdb#14714
Open
EternalRights wants to merge 2 commits into
Open
Conversation
Turns out the CPython change in 3.14 doesn't just suppress BdbQuit -- pdb calls os._exit(0) directly, which gives pytest no chance to react. The call_and_report handler still catches BdbQuit raised from code (like the unittest test), but Ctrl+D simulation via EOFError is fundamentally unreachable on 3.14+. Updated the changelog to be honest about the limitation instead of claiming consistency across all versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was testing pdb with
--pdbon Python 3.14 and noticed Ctrl+D behaves differently than 3.13 -- on 3.13 it fails the current test and keeps going, on 3.14 it just quits the whole session without even reporting the failure. Neither is great.Ronny's call in #13453 was "fail + should stop in all cases", so that's what this does. When BdbQuit comes up during any runtest phase, set
session.shouldstop-- the current test still gets reported as failed, teardown runs normally, then the session stops.Removed the xfail on
test_raises_bdbquit_with_eoferrorand added a second test to verify the session actually stops. Also updatedtest_BdbQuitin test_unittest.py sincetest_should_not_runno longer runs.One thing I wasn't sure about: the
shouldstopmessage is"Debugger quit (BdbQuit)". Happy to change it if there's a preferred format.