[Biopython-dev] docstring tests
Bruce Southey
bsouthey at gmail.com
Wed Feb 11 10:16:41 EST 2009
Peter wrote:
>> There is also one failure with Python 2.3 which does not test docstrings:
>>
>> ======================================================================
>> ERROR: Test Nexus module
>> ----------------------------------------------------------------------
>> Traceback (most recent call last):
>> File "test_Nexus.py", line 92, in test_NexusTest1
>> self.assertTrue('codons' in n.charpartitions)
>> AttributeError: 'NexusTest1' object has no attribute 'assertTrue'
>>
>
> That is because the unittest assertTrue is only available on python
> 2.4+, so we should add a quick workaround with a note that this can be
> simplified once we drop Python 2.3 support.
>
> Peter
>
I think these (as there are more than one) should be using failUnless
instead:
self.failUnless('codons' in n.charpartitions)
From the docstring
| failUnless(self, expr, msg=None)
| Fail the test unless the expression is true.
Bruce
More information about the Biopython-dev
mailing list