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

Pytest Style core/test_requires.py #1626

Merged
merged 2 commits into from
Aug 21, 2017

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

else:
raise AssertionError("Should raise NoDataError")
raise pytest.fail(msg="Should raise NoDataError")
Copy link
Member

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?

Copy link
Member

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).

@utkbansal utkbansal changed the title [Review Needed]Pytest Style core/test_requires.py Pytest Style core/test_requires.py Aug 15, 2017
Copy link
Member

@orbeckst orbeckst left a 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().

else:
raise AssertionError("Should raise NoDataError")
raise pytest.fail(msg="Should raise NoDataError")
Copy link
Member

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")

@kain88-de
Copy link
Member

@utkbansal please address the issues

@richardjgowers richardjgowers merged commit 38e9e92 into MDAnalysis:develop Aug 21, 2017
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

Successfully merging this pull request may close these issues.

None yet

5 participants