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

Use pytest.raises match over checking for string content manually #2161

Closed
matthewfeickert opened this issue Apr 6, 2023 · 0 comments · Fixed by #2162
Closed

Use pytest.raises match over checking for string content manually #2161

matthewfeickert opened this issue Apr 6, 2023 · 0 comments · Fixed by #2162
Assignees
Labels
tests pytest

Comments

@matthewfeickert
Copy link
Member

These were previously not doing anything and have to be moved outside the pytest.raises to actually work. I checked other places in the tests where the same pattern is used and there it all seemed fine.

There's also built-in functionality to do this quite conveniently:

with pytest.raises(RuntimeError, match="SigXsecOverSM"):
    ...

Originally posted by @alexander-held in #2109 (comment)

This is great and should be applied everywhere!

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

Successfully merging a pull request may close this issue.

1 participant