Repository navigation
changed assertion styling for test_Restriction.py - #3276
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3276 +/- ##
==========================================
- Coverage 83.93% 83.93% -0.01%
==========================================
Files 317 317
Lines 51556 51584 +28
==========================================
+ Hits 43275 43297 +22
- Misses 8281 8287 +6
Continue to review full report at Codecov.
|
| self.assertFalse(Acc65I == Asp718I) | ||
| self.assertEqual(Acc65I == Asp718I, False) | ||
| # self.assertNotEqual(Acc65I, Asp718I) it doesn't work as expected | ||
| self.assertFalse(Acc65I != Asp718I) |
There was a problem hiding this comment.
This and the line above look like the problem cases, and I think that neither self.assertEqual nor self.assertNotEqual will work here? I've not tried that, but I did look at the source code:
However, I think the originals using self.assertFalse are actually clearer than self.assertEqual(..., False).
I'm going to ask for a second opinion, but I would be inclined to leave these two lines as they are. We could add the special comment # noqa: A500 to tell flake8 to ignore the warning from flake8-assertive (if installed).
@MarkusPiotrowski could you comment?
There was a problem hiding this comment.
Thanks for review.
Should I wait for his response?
There was a problem hiding this comment.
Wait for now - the second opinion might be different.
There was a problem hiding this comment.
Bio.Restriction overwrites the == and != comparisons for some special meaning regarding neo- and isoschizomers. So what is actually tested here are the comparison operators and thus I think that the original tests are indeed clearer.
There was a problem hiding this comment.
Thanks Markus.
@lacrosse91 could you revert those two lines (and optionally add the # noqa: A500 comment - which should make flake8-assertive happy and document this use of assertTrue is deliberate).
peterjc
left a comment
There was a problem hiding this comment.
See comments about the Acc65I == Asp718I and Acc65I != Asp718I tests.
|
@peterjc and @MarkusPiotrowski |
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, have runpre-commitlocally,and understand that AppVeyor and TravisCI will be used to confirm the Biopython unit
tests and style checks 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.)
This pull request addresses issue #2835