-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Clarify regex match error in pytest.raises #13855
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to remove the comment at the same time ?
Co-authored-by: Pierre Sassoulas <[email protected]>
Yeah ofcourse, I didn't want to remove it myself until they are okay with it |
Comment saying """ # I don't love "Regex"+"Input" vs something like "expected regex"+"exception message" # when they're similar it's not always obvious which is which" """ is now removed for clarity
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a suggestion. Also need to fix the failing tests.
Co-authored-by: Ran Benita <[email protected]>
c480ceb to
bf27097
Compare
3359dd2 to
582107b
Compare
for more information, see https://pre-commit.ci
|
Will create another one with clear instructions and commits |
Purpose
This PR addresses the
TODOinAbstractRaises._check_matchwhich notes that the error message for a regex mismatch can be confusing.The previous message used
Regex:andInput:, which could be ambiguous.This change updates the
_fail_reasonstring to be more explicit:Regex:->Expected regex:Input:->Actual message:This makes the failure message clearer and easier to debug for users, as requested in the code comment.