[Review Needed]Pytest Style topology/test_gro.py #1590
Merged
Conversation
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']: |
jbarnoud
Aug 5, 2017
Contributor
The loops are meaningless: the attr
variable is not used.
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)): |
jbarnoud
Aug 5, 2017
Contributor
We probably can compare the full arrays rather than comparing element per element.
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] |
jbarnoud
Aug 5, 2017
Contributor
It may be clearer written like: i, (resid, resname) = args
.
It may be clearer written like: i, (resid, resname) = args
.
|
||
def test_sameresid_diffresname(): | ||
@pytest.mark.parametrize( |
richardjgowers
Aug 5, 2017
Member
this doesn't really need to be parametrized, it all tests the same thing, rather than different cases of something
this doesn't really need to be parametrized, it all tests the same thing, rather than different cases of something
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Fixes #
Changes made in this Pull Request:
PR Checklist