Repository navigation
Enforce E127 and E128 on Tests/ - #1780
Conversation
Files updated: MSAProbs_tool, HMMGeneral, Pathway.
Files updated: Emboss, Nexus, SeqUtils.
Needs further testing.
Codecov Report
@@ Coverage Diff @@
## master #1780 +/- ##
=======================================
Coverage 85.43% 85.43%
=======================================
Files 331 331
Lines 50209 50209
=======================================
Hits 42896 42896
Misses 7313 7313Continue to review full report at Codecov.
|
| # F841 local variable name is assigned to but never used | ||
| # TODO: Fix some of these? | ||
| E127,E128,E402,E501,E731,F401,F405,F841, | ||
| E402,E501,E731,F401,F405,F841, |
There was a problem hiding this comment.
We can remove E127 and E128 from the comments 9 lines up too.
| ctl_file = os.path.join("Control_files", "baseml", | ||
| "{0}{1}.ctl".format(test[0], n)) | ||
| ctl_file = (os.path.join("Control_files", "baseml", | ||
| "{0}{1}.ctl".format(test[0], n))) |
There was a problem hiding this comment.
Does fixing the indentation alone (without adding brackets) make the second line too long?
| bml.out_file = os.path.join("Results", "baseml", test[0], | ||
| out_file) | ||
| bml.out_file = (os.path.join("Results", "baseml", test[0], | ||
| out_file)) |
There was a problem hiding this comment.
Does fixing the indentation alone (without adding brackets) make the second line too long?
| str(input_records[record.id].seq)) | ||
| self.assertEqual(str(record.seq), | ||
| str(output_records[record.id].seq)) | ||
| self.assertEqual(str(record.seq).replace("-", ""), |
There was a problem hiding this comment.
Good fix - I can't use the excuse this was only supported in Python 2.7 onwards, it should probably always have been self.assertEqual
| assert percent_mutants > expected_percent, \ | ||
| "Did not receive an acceptable number of mutations." | ||
| self.assertGreater(percent_mutants, expected_percent, | ||
| "Did not receive an acceptable number of mutations.") |
There was a problem hiding this comment.
Good. There maybe more cases like this where now that we've dropped Python 2.6 support we can use the more specific assert methods.
| 20 33 -1 -1 -1 29 -1 -1 28 28 -1 7 16 5 -1 30 -1 -1 -1 14 -1 4 13 4 -1 -1 11 13 -1 5 -1 7 -1 -1 10 16 -1 4 12 15 -1 8 -1 -1 -1 16 -1 -1 10 4 | ||
| >1117_10_1017_F3 | ||
| 33 33 -1 -1 -1 27 -1 -1 17 16 -1 28 24 11 -1 6 -1 -1 -1 29 -1 8 29 24 -1 -1 8 8 -1 20 -1 13 -1 -1 8 13 -1 28 10 24 -1 10 -1 -1 -1 4 -1 -1 7 6 | ||
| 33 33 -1 -1 -1 27 -1 -1 17 16 -1 28 24 11 -1 6 -1 -1 -1 29 -1 8 29 24 -1 -1 8 8 -1 20 -1 13 -1 -1 8 13 -1 28 10 24 -1 10 -1 -1 -1 4 -1 -1 7 6 |
There was a problem hiding this comment.
The trailing whitespace here might have been deliberate (the parser should accept it), but removing it is probably fine.
|
This looks great - a couple of tiny bits which could be even better, but this kind of pull request can easily get out of date an make more work with merge conflicts, so I'm going to apply it now. Thanks you 👍 |
|
Thanks for looking this over @bow - two sets of eyes is sensible on a change of this size. |
This pull request addresses issue #1769
These changes were made to comply with line continuation style checks, which were enabled in the Tests directory.
Changes were primarily made to whitespace, with some reorganization of long text lines. Several
assertstatements were also changed to theunittestequivalent.I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile and understand that AppVeyor andTravisCI will be used to confirm the Biopython unit tests and
flake8stylechecks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)
There are multiple ways to address the style changes for nearly everything fixed here, I welcome any feedback or suggestions.