Skip to content
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

Potential confusion if error messages contain special chars e.g. parens #227

Open
tallus opened this issue Mar 3, 2023 · 0 comments
Open

Comments

@tallus
Copy link

tallus commented Mar 3, 2023

def raise_error():
    raise AssertionError("Message with  (parens)")

assert_that(calling(raise_error),  raises(AssertionError, "Message with (parens)")

will fail with Correct assertion type raised, but the expected pattern ("Message with (parens)") not found. Exception message was: "Message with (parens)" which is a somewhat confusing message.

#226 resolves this by ensuring a regex mismatch only occurs if the pattern is not also a literal match for the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant