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 topology/test_gro.py #1590
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more file about to bite the dust. A few things to fix, though.
@@ -54,11 +48,11 @@ class TestGROParser(ParserBase): | |||
|
|||
def test_attr_size(self, top): | |||
for attr in ['ids', 'names']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loops are meaningless: the attr
variable is not used.
resids = [1, 99999, 100000, 100001, 199999, 200000, 200001] | ||
|
||
assert_(top.tt.size == (126, 7, 1)) | ||
assert top.tt.size == (126, 7, 1) | ||
for i, (r, n, l) in enumerate(zip(resids, self.names, self.lengths)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably can compare the full arrays rather than comparing element per element.
def test_sameresid_diffresname(args): | ||
i = args[0] | ||
resid = args[1][0] | ||
resname = args[1][1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be clearer written like: i, (resid, resname) = args
.
|
||
def test_sameresid_diffresname(): | ||
@pytest.mark.parametrize( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't really need to be parametrized, it all tests the same thing, rather than different cases of something
Fixes #
Changes made in this Pull Request:
PR Checklist