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_atom.py #1535

Merged
merged 3 commits into from
Jul 25, 2017
Merged

Conversation

utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

assert atom.charge == 6

def test_attributes_positions(self, atom):
a = atom
# new position property (mutable)
assert_almost_equal(a.position, self.known_pos)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

known_pos is used once within the class, it can just live in this method

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@jbarnoud jbarnoud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very little to change.

def lookup_velo():
return self.atom.velocity
return atom.velocity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are using the context manager to test the exception, you do not need the nested function.

def bad_add():
return self.atom + 1
return atom + 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do not need the nested function here.

@utkbansal
Copy link
Member Author

@jbarnoud @richardjgowers Good to go now?

@kain88-de
Copy link
Member

@utkbansal I've restarted the travis build. I'm curious why there is a drop of 0.03 percent in coverage. Maybe it goes away after rerunning the test but it would be nice if you could have a look into this.

@utkbansal
Copy link
Member Author

@kain88-de 0.01% Coveralls shows nothing.

@richardjgowers richardjgowers merged commit d97da42 into MDAnalysis:develop Jul 25, 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

4 participants