Skip to content

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

Merged
kain88-de merged 2 commits intoMDAnalysis:developfrom
utkbansal:coord-lammps
Aug 27, 2017
Merged

[Review Needed]Pytest Style coordinates/test_lammps.py#1644
kain88-de merged 2 commits intoMDAnalysis:developfrom
utkbansal:coord-lammps

Conversation

@utkbansal
Copy link
Member

Fixes #

Changes made in this Pull Request:

PR Checklist

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

def test_seek(self, u):
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.

2 participants