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

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)
Copy link
Member

Choose a reason for hiding this comment

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

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' + \
Copy link
Member

Choose a reason for hiding this comment

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

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

Don't join paths manually!

Copy link
Member

Choose a reason for hiding this comment

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

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' + \
Copy link
Member

Choose a reason for hiding this comment

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

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' + \
Copy link
Member

Choose a reason for hiding this comment

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

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' + \
Copy link
Member

Choose a reason for hiding this comment

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

see comment above

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

@kain88-de Anything else needed here?

@kain88-de kain88-de merged commit be5d599 into MDAnalysis:develop Aug 27, 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

2 participants