-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Correctly handle should_panic
doctest attribute
#143453
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
base: master
Are you sure you want to change the base?
Conversation
|
This PR modifies cc @jieyouxu |
Ah, someone else then (sorry for the ping). r? notriddle |
This comment has been minimized.
This comment has been minimized.
I don't like this: this causes |
I can't get this information from just within the same process, I think I'll create a file in case the |
Can we maybe just compare the exit code with 101? It's exceedingly that unlikely that someone uses this exit code within a |
Does it work on windows? |
It should, yeah. We use the same exit code regardless of the platform.. |
I wasn't super happy about this approach but I guess it's rare enough so that we can use it. |
fa0b191
to
fc69714
Compare
This comment has been minimized.
This comment has been minimized.
f134d32
to
5bc0760
Compare
This comment has been minimized.
This comment has been minimized.
5bc0760
to
67a0598
Compare
This comment has been minimized.
This comment has been minimized.
67a0598
to
42b2318
Compare
This comment has been minimized.
This comment has been minimized.
42b2318
to
9d565a3
Compare
Fixes #143009.
Instead of checking the exit code, we directly wrap the doctest code with
catch_unwind
and if apanic
happened, then we return success for the test, otherwise we display the appropriate error message.I think last one who reviewed doctest changes was @fmease so setting you as reviewer. :)
r? fmease