[Biopython-dev] Rethinking Biopython's testing framework

Giovanni Marco Dall'Olio dalloliogm at gmail.com
Sat Dec 27 08:48:09 UTC 2008


On Fri, Dec 26, 2008 at 10:40 PM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
> --- On Fri, 12/26/08, Giovanni Marco Dall'Olio <dalloliogm at gmail.com> wrote:
>> > If we use nose, does that mean adding another
>> dependency to Biopython? If so, I don't think it's
>> worth it. If not, how does this work?
>>
>> nose is a testing framework, so it is a dependency only for
>> developers.
>
> If we use nose, can our users still run the Biopython tests (without having to install nose first)?

Yes, but they will have to do it manually, or with a wrapper script
(as it is now).

Basically, we will have to move every test in functions/classes with
names beginning with 'test_'. To be more precise, they should match
the regular expression '(?:^|[b_.-])[Tt]est' (it is also possible to
coustomize this regex).

So, if a test now is it like this:

if __name__ == '__main__':
    seq = Seq('sadasda')
    assert seq.tostring() == 'sadasda'

we will have to refactor it like this:

def _test():
    """test description"""
    seq = Seq('sadasda')
    assert seq.tostring() == 'sadasda'

if __name__ == '__main__':
    _test()   # this is optional



> --Michiel.
>
>
>
>



-- 

My blog on bioinformatics (now in English): http://bioinfoblog.it



More information about the Biopython-dev mailing list