-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Replace assertTrue with assertIn/assertNotIn when suitable #1020
Conversation
@@ -87,7 +87,7 @@ def test_Mafft_simple(self): | |||
# became "Progressive alignment 1/2..." and "Progressive alignment 2/2..." | |||
self.assertTrue(("Progressive alignment ..." in stderrdata) or | |||
("Progressive alignment 1/" in stderrdata), stderrdata) | |||
self.assertTrue("$#=0" not in stderrdata) | |||
self.assertNotIn("$#=0" , stderrdata) |
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.
You have an extra space before the comma, which is why TravisCI's pep8 check is failing (here and elsewhere)
recs = list(Entrez.parse(handle)) | ||
handle.close() | ||
self.assertEqual(3, len(recs)) | ||
# arbitrary number, just to make sure the parser works | ||
self.assertTrue(all(len(rec).keys > 5) for rec in recs) | ||
self.assertIn(all(len(rec).keys > 5) for rec, recs) |
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 is now giving a syntax error and causing TravisCI to fail the test. This is actually a generator expression inside an all(...)
call.
Almost perfect - you need to fix the syntax error in To run the PEP8 check locally,
|
Once those minor issues are fixed, this should be ready to merge. Are you happy to dual licence your contributions under both the Biopython License Agreement and the BSD 3-Clause License? See #898. Also, are you happy to be thanked by name in the Thanks! |
This closes issue 1006 assertTrue(a in b) is now assertIn(a, b) assertTrue(a in b, b) is assertIn(a, b) assertTrue(a in b, message) is assertIn(a, b, message) The same for 'not in', by using assertNotIn
I've fixed the spacing and the line 70 problem :) Yes, I'm happy about both those things. Thanks! |
Thank you very very much. |
See pull request biopython#1020 which closes biopython#1006.
Original authors Thomas Hamelryck and Eric Talevich (for the unittest conversion), and the contributors as tracked with version control have agreed: - Andrew Guy (@andrewguy) biopython#2212 (comment) - Ben Reynwar (@benreynwar) biopython#898 (comment) - Bernhard C. Thiel (@Bernhard10) biopython#968 - Carlos Pena (@carlosp420) biopython#898 (comment) - Chris Rands (@chris-rands) biopython#1301 - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Eric Talevich (@etal) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Gokcen Eraslan (@gokceneraslan) biopython#898 (comment) - Jack Twilley (@mathuin) biopython#1049 (comment) - Jeroen Van Goey (@BioGeek) biopython#898 (comment) - Joe Greener (@jgreener64) biopython#1393 - Joerg Schaarschmidt (@schaarj) biopython#1567 - João Rodrigues (@JoaoRodrigues) biopython#898 (comment) - Kian Ho (@kianho) biopython#898 (comment) - Kristian Davidsen (@krdav) biopython#898 (comment) - Kristian Rother (@krother) biopython#898 (comment) - Lenna Peterson (@lennax) biopython#898 (comment) - Markus Piotrowski (@MarkusPiotrowski) biopython#898 (comment) - Milind Luthra (@milindl) biopython#1020 - Nick Negretti (@nimne) biopython#1768 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Rasmus Fonseca (@RasmusFonseca) biopython#1171 (comment) - Siong Kong (@siongkong) biopython#1516 - Stefans Mezulis (@StefansM) biopython#1445 - Thomas Hamelryck (CVS username nisse) https://mailman.open-bio.org/pipermail/biopython/2018-September/016546.html
Named copyright holders and other contributors tracked with version control have all agreed: - Benjamin Rowell (@benjaminr) biopython#2023 - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Chris Warth (@cswarth) biopython#898 (comment) - Christian Brueffer (@cbrueffer) biopython#898 (comment) - Eric Talevich (@etal) biopython#898 (comment) - Francesco Gastaldello (@Gasta88) biopython#1063 - Frank Kauff (@frankkl) biopython#2246 (comment) - Iddo Friedberg (@idoerg) biopython#898 (comment) - Joe Cora (@JoeCora) biopython#898 (comment) - Michiel de Hoon (@mdehoon) biopython#898 (comment) - Milind Luthra (@milindl) biopython#1020 - Nick Negretti (@nimne) biopython#1768 (comment) - Peter Cock (@peterjc) biopython#898 (comment) - Sourav Singh (@souravsingh) biopython#957 - Steve Bond (@biologyguy) biopython#898 (comment) - Tiago Antao (@tiagoantao) biopython#898 (comment) - Vincent Davis (@vincentdavis) biopython#898 (comment)
Named copyright holders and other contributors tracked with version control have all agreed: - Benjamin Rowell (@benjaminr) #2023 - Brad Chapman (@chapmanb) http://mailman.open-bio.org/pipermail/biopython-dev/2013-July/019903.html - Chris Warth (@cswarth) #898 (comment) - Christian Brueffer (@cbrueffer) #898 (comment) - Eric Talevich (@etal) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - Frank Kauff (@frankkl) #2246 (comment) - Iddo Friedberg (@idoerg) #898 (comment) - Joe Cora (@JoeCora) #898 (comment) - Michiel de Hoon (@mdehoon) #898 (comment) - Milind Luthra (@milindl) #1020 - Nick Negretti (@nimne) #1768 (comment) - Peter Cock (@peterjc) #898 (comment) - Sourav Singh (@souravsingh) #957 - Steve Bond (@biologyguy) #898 (comment) - Tiago Antao (@tiagoantao) #898 (comment) - Vincent Davis (@vincentdavis) #898 (comment)
Original authors Thomas Hamelryck and Eric Talevich (for the unittest conversion), and the contributors as tracked with version control have agreed: - Andrew Guy (@andrewguy) #2212 (comment) - Ben Reynwar (@benreynwar) #898 (comment) - Bernhard C. Thiel (@Bernhard10) #968 - Carlos Pena (@carlosp420) #898 (comment) - Chris Rands (@chris-rands) #1301 - Christian Brueffer (@cbrueffer) #898 (comment) - Eric Talevich (@etal) #898 (comment) - Francesco Gastaldello (@Gasta88) #1063 - Gokcen Eraslan (@gokceneraslan) #898 (comment) - Jack Twilley (@mathuin) #1049 (comment) - Jeroen Van Goey (@BioGeek) #898 (comment) - Joe Greener (@jgreener64) #1393 - Joerg Schaarschmidt (@schaarj) #1567 - João Rodrigues (@JoaoRodrigues) #898 (comment) - Kian Ho (@kianho) #898 (comment) - Kristian Davidsen (@krdav) #898 (comment) - Kristian Rother (@krother) #898 (comment) - Lenna Peterson (@lennax) #898 (comment) - Markus Piotrowski (@MarkusPiotrowski) #898 (comment) - Milind Luthra (@milindl) #1020 - Nick Negretti (@nimne) #1768 (comment) - Peter Cock (@peterjc) #898 (comment) - Rasmus Fonseca (@RasmusFonseca) #1171 (comment) - Siong Kong (@siongkong) #1516 - Stefans Mezulis (@StefansM) #1445 - Thomas Hamelryck (CVS username nisse) https://mailman.open-bio.org/pipermail/biopython/2018-September/016546.html
This should close #1006
assertTrue(a in b) is now assertIn(a, b)
assertTrue(a in b, b) is assertIn(a, b)
assertTrue(a in b, message) is assertIn(a, b, message)
The same for 'not in', by using assertNotIn()
In cases where there was any doubt, I just left them unchanged for safety.
Thanks!