Skip to content

Continue --stepwise from a test interrupted by quitting the debugger - #15268

Open
LuanaPBueno wants to merge 1 commit into
pytest-dev:mainfrom
LuanaPBueno:stepwise-continue-after-debugger-quit
Open

LuanaPBueno wants to merge 1 commit into
pytest-dev:mainfrom
LuanaPBueno:stepwise-continue-after-debugger-quit

Conversation

@LuanaPBueno

Copy link
Copy Markdown
Contributor

Hi! When you quit the debugger with q in the middle of a --stepwise run, pytest stops the whole session right away, so the test that was running never gets a failed report. Because of that, the next --stepwise run 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() and q, 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

  • Include new tests or update existing tests when applicable.
  • Allow maintainers to push and squash when merging my commits.
  • Add text like closes #XYZW to the PR description and/or commits.
  • If AI agents were used, they are credited in Co-authored-by commit trailers.
  • Create a new changelog file in the changelog directory.
  • Add yourself to AUTHORS in alphabetical order (I did this in pytest-dev/pytest#15202 (already merged), so my name is already in the list).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--stepwise should continue from the test aborted with a BdbQuit

1 participant