Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit console via continue during pytest interactive debugging #989

Merged
merged 2 commits into from
Mar 14, 2021

Conversation

iamdefinitelyahuman
Copy link
Member

What I did

Modify how the console is exited during pytest interactive debugging:

  • continue runs the next test
  • exit() or quit() halts execution

This might surprise some people who've gotten used to the current behavior but I'm guessing more will like it than dislike it.

How I did it

Added a exit_on_continue kwarg to the init method of Console. When True, a check in Console.runsource checks the source before compiling, and if continue is found, it raises a SystemExit with error message "continue". This error message is then caught in the pytest runner and used to decide how to interpret the exit command.

How to verify it

Try it.

@iamdefinitelyahuman iamdefinitelyahuman merged commit 74f2cbf into master Mar 14, 2021
@iamdefinitelyahuman iamdefinitelyahuman deleted the feat-console-exit branch March 14, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants