-
Notifications
You must be signed in to change notification settings - Fork 737
Pytest Style core/test_requires.py #1626
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
| assert 'frogs' in message | ||
| else: | ||
| raise AssertionError("Should raise NoDataError") | ||
| raise pytest.fail(msg="Should raise NoDataError") |
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.
is pytest.fail an exception?
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.
No, pytest.fail is a function and should just be called:
pytest.fail(msg="Should raise NoDataError")(See also real world examples).
orbeckst
left a comment
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.
See comment on pytest.fail().
| assert 'frogs' in message | ||
| else: | ||
| raise AssertionError("Should raise NoDataError") | ||
| raise pytest.fail(msg="Should raise NoDataError") |
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.
Do not raise, just use imperatively:
else:
pytest.fail(msg="Should raise NoDataError")|
@utkbansal please address the issues |
Fixes #
Changes made in this Pull Request:
PR Checklist