-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 pytest cleanly "mid" run #3574
Comments
GitMate.io thinks possibly related issues are #1421 (Exit pytest if a collection error occours), #471 (pytest keeps running deleted tests), #3106 (Exit code 1 when pytest crashes on loading plugin), #3556 ([Question] Can I run pytest on a read-only filesystem?), and #3557 (Run pytest on read-only file systems). |
Hi @BeyondEvil, what do you mean by "cleanly" exactly? Raising |
@nicoddemus Sorry, I should've been clearer. I basically want to exit with exitstatus 0 (zero) and no warnings/errors. I'll try raising session.Interrupted, but from the sound of it that won't give me exitstatus 0... |
I see, thanks for the clarification. I don't think there's support for that out of the box currently. I guess it could be implemented by adding a |
@nicoddemus Hello there! Has there been any progress on adding the ability to control the exit code? |
@ofek not AFAIK. Seems it should be simple to implement if someone wants to give this a try. 😁 |
I'm closing this one in favor of #4098 👍 |
I'm looking for certain conditions in the
pytest_sessionstart()
hook and I want to be able to stop/exit/abort further execution in a clean way.Any idea how I can accomplish this? Neither
pytest.exit()
orsys.exit()/exit()
does it cleanly.Thanks!
The text was updated successfully, but these errors were encountered: