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

[Review Needed]Pytest Style coordinates/test_lammps.py #1644

Merged
merged 2 commits into from Aug 27, 2017

Conversation

@utkbansal
Copy link
Member

@utkbansal utkbansal commented Aug 25, 2017

Fixes #

Changes made in this Pull Request:

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?
with pytest.raises(IndexError):
self.u.trajectory.__getitem__(1)
u.trajectory.__getitem__(1)

This comment has been minimized.

@kain88-de

kain88-de Aug 25, 2017
Member

u.trajectory[1]

return mda.Universe(self.topology, self.trajectory, format=self.format)

def test_Writer_is_LAMMPS(self, u, tmpdir):
outfile = str(tmpdir) + 'lammps-writer-test' + \

This comment has been minimized.

@kain88-de

kain88-de Aug 25, 2017
Member

outfile = os.path.join(str(tmpdir), 'lammps-writer-test' + ext)

Don't join paths manually!

This comment has been minimized.

@kain88-de

kain88-de Aug 25, 2017
Member

In general those manual line breaks with \ are also not that nice and should be avoided if possible.

assert W.flavor, self.flavor

def test_Writer(self, u, tmpdir, n_frames=3):
outfile = str(tmpdir) + 'lammps-writer-test' + \

This comment has been minimized.

@kain88-de

kain88-de Aug 25, 2017
Member

see comment above

with self.u.trajectory.OtherWriter(self.outfile) as W:
assert_(W.flavor, self.flavor)
def test_OtherWriter_is_LAMMPS(self, u, tmpdir):
outfile = str(tmpdir) + 'lammps-writer-test' + \

This comment has been minimized.

@kain88-de

kain88-de Aug 25, 2017
Member

see comment above

times = []
with self.u.trajectory.OtherWriter(self.outfile) as w:
for ts in self.u.trajectory[::-1]:
outfile = str(tmpdir) + 'lammps-writer-test' + \

This comment has been minimized.

@kain88-de

kain88-de Aug 25, 2017
Member

see comment above

@kain88-de kain88-de self-assigned this Aug 25, 2017
@utkbansal
Copy link
Member Author

@utkbansal utkbansal commented Aug 26, 2017

@kain88-de Anything else needed here?

@kain88-de kain88-de merged commit be5d599 into MDAnalysis:develop Aug 27, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.01%) to 90.603%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants