[Biopython-dev] [Bug 2749] Proposal: a template for biopython's unittests

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Feb 13 16:58:29 UTC 2009


http://bugzilla.open-bio.org/show_bug.cgi?id=2749





------- Comment #6 from dalloliogm at gmail.com  2009-02-13 11:58 EST -------
(In reply to comment #5)
> I think we have resolved this by extending the main tutorial (in CVS) to
> include a unittest example.  This work also replaces the existing (slightly out
> of date) unit test examples, which have been deleted in CVS:
> http://biopython.org/DIST/docs/cookbook/biopython_test.html
> http://biopython.org/DIST/docs/cookbook/biopython_test.pdf
> 
> Marking bug as fixed.

In the example, you could add a comment in the setUp and tearDown functions,
something like:
def setUp(self):
    """these instructions will be executed *before* each of the tests in this
unit"""

and 

def tearDown(self):
    """these instructions will be executed *after* each of the tests in this
unit"""

It will make it clearer.

Moreover, the python's library reference for unittest explain very clearly how
fixtures and unittest works, maybe it's worth to add a link to it somewhere:
- http://www.python.org/doc/2.5.2/lib/module-unittest.html

I would also structure the test in a slightly different way.. I would put
'filename' in a separated variable (easier to read), and I would add a
knowValues test as example.

Finally, if you want to add a comment on global fixture, you can say it is
possible to implement them with the 'self._is_set_up' trick.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list