-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add configuration option for ignoring panic!()
in tests
#12803
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @y21 (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
It might already be clear that this would work, but do you mind adding some tests to justify it? Similar to |
I added the test, I took an inspiration from the |
Looks great, thanks! @bors r+ |
Add configuration option for ignoring `panic!()` in tests ``` changelog: [`panic`]: Now can be disabled in tests with the `allow-panic-in-tests` option ``` I often find myself using `panic!(…)` in tests a lot, where I often do something like: ```rust match enam { Enam::A => …, Enam::B => …, _ => panic!("This should not happen at all."), } ``` I think this patch should go nicely with already existing `allow-unwrap-in-tests` and `allow-expect-in-tests`.
💔 Test failed - checks-action_test |
Needs a |
Updated 🤞 . You were right, missing in the changelog. |
@bors r+ |
Add configuration option for ignoring `panic!()` in tests ``` changelog: [`panic`]: Now can be disabled in tests with the `allow-panic-in-tests` option ``` I often find myself using `panic!(…)` in tests a lot, where I often do something like: ```rust match enam { Enam::A => …, Enam::B => …, _ => panic!("This should not happen at all."), } ``` I think this patch should go nicely with already existing `allow-unwrap-in-tests` and `allow-expect-in-tests`.
💔 Test failed - checks-action_test |
Is it possible that I have somehow managed to break only the windows build with this patch? From the pipeline log it seems to me, that it is unable to initialize the toolchain.
|
I'm not at home right now so I can't properly take a look at it (Github won't even let me view the logs), but that looks very spurious/unrelated to the change here, so... @bors retry |
Add configuration option for ignoring `panic!()` in tests ``` changelog: [`panic`]: Now can be disabled in tests with the `allow-panic-in-tests` option ``` I often find myself using `panic!(…)` in tests a lot, where I often do something like: ```rust match enam { Enam::A => …, Enam::B => …, _ => panic!("This should not happen at all."), } ``` I think this patch should go nicely with already existing `allow-unwrap-in-tests` and `allow-expect-in-tests`.
💔 Test failed - checks-action_test |
Nah, look's like it's just the CI is having a stroke, same go here, don't worry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
I often find myself using
panic!(…)
in tests a lot, where I often do something like:I think this patch should go nicely with already existing
allow-unwrap-in-tests
andallow-expect-in-tests
.