Repository navigation
Continue --stepwise from a test interrupted by quitting the debugger - #15268
Open
LuanaPBueno wants to merge 1 commit into
Open
LuanaPBueno wants to merge 1 commit into
LuanaPBueno wants to merge 1 commit into
Conversation
Closes pytest-dev#10562 Co-authored-by: Claude <noreply@anthropic.com>
This branch has not been deployed
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.
Hi! When you quit the debugger with
qin the middle of a--stepwiserun, pytest stops the whole session right away, so the test that was running never gets a failed report. Because of that, the next--stepwiserun started over from the beginning instead of continuing from that test.Now the stepwise plugin keeps track of the test that is currently running, and if the session is interrupted while a test is running, that test is saved as the one to continue from. I also tried it by hand with a real
breakpoint()andq, and the next run continued from the right test.One thing to note: this also applies to other interruptions that happen in the middle of a test (for example Ctrl+C), not only quitting the debugger. I think that makes sense for
--stepwise, but happy to narrow it down if you prefer!I used Claude to help, but I reviewed all the changes, ran the tests locally and checked that the new test fails without the fix.
Closes #10562
closes #XYZWto the PR description and/or commits.Co-authored-bycommit trailers.changelogdirectory.AUTHORSin alphabetical order (I did this in pytest-dev/pytest#15202 (already merged), so my name is already in the list).