-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
TST: Fix some bare pytest raises #31105
TST: Fix some bare pytest raises #31105
Conversation
5ff8410
to
c4f5f1d
Compare
@MomIsBestFriend might be misreading but I don't really understand this PR. Is this de-parametrizing an existing test? |
Correct, because I had troubles in #30998 to put a correct "match" value (trying to remove bare pytest raises statement). I was having something that looked kinda like this:
(That value did not work) I think, IMO the "de-parameterization" functions is more readable and maintainable (And I was able to fix the bare pytests raises statement). |
I think should keep the original parametrization. The error messages are of secondary importance so don't need to be exact. You can just pick a simpler pattern like |
I know that I will commit the parameterized test, with the nested Also, side question, does the parameterized test is more performant? (trying to see why the de-parameterized test is less likeable) |
I don't think it matters but even if it did should strongly prefer parametrized tests to breaking out individually; the latter is tougher to extend and maintain over time and leads to more lapses in coverage |
@WillAyd You were 100% right! |
(unrelated) |
Thanks @MomIsBestFriend and answer to your question depends on per-user settings |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Follow up for #30998