Skip to content

Conversation

@utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

assert 'frogs' in message
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().

assert 'frogs' in message
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 dismissed orbeckst’s stale review August 21, 2017 09:21

has been addressed

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

5 participants