You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Until recently we supported Python 2.6, where the unittest library did not support the self.assertIn(search_term, thing_to_search) method meaning we used self.assertTrue(search_term in thing_to_search) instead, often with a message term.
I fixed a couple just now where there was a TODO comment: 0da3844
There are over 200 of these examples remaining, e.g.
$ cd Tests/
$ grep assertTrue *.py | grep " in "
common_BioSQL.py: self.assertTrue("biosql-test" in server)
common_BioSQL.py: self.assertTrue("biosql-test2" in server)
common_BioSQL.py: self.assertTrue("biosql-test" in server)
...
Fixing these by hand would be extremely tedious, but with a little regular expression knowledge you can probably do this in one line of awk or perl etc. Or write a Python script to do it?
Activity
souravsingh commentedon Nov 23, 2016
I would like to take a stab at the issue
peterjc commentedon Nov 24, 2016
Great - if you can solve this using awk or a similar approach, it would be great if you could post your solution here too.
Replace assertTrue with assertIn/assertNotIn when suitable
Thank Milind for test updates.
Thank Milind for test updates.