[Biopython-dev] Rethinking Biopython's testing framework

Peter biopython at maubp.freeserve.co.uk
Sun Dec 28 16:51:58 UTC 2008


On Wed, Dec 24, 2008 at 10:52 AM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
>
> Hi everybody,
>
> How about the following for Biopython tests:
>
> For Python's unittest-style test modules, Python's unittest documentation
> recommends to define a function in each test module that returns the
> test suite. Most Biopython tests that use the unittest framework already
> do this (the function is called "testing_suite".
>
> We could now do the following in run_tests.py:
>
> 1) import the testing module and save its output
> 2) try to call module.testing_suite
> 3) if it exists, then we're using Python's unittest framework.
> So we run the tests in the testing suite.
> 4) if it does not exist, then we're using the print-and-compare
> approach. So we compare the saved output from the test to the correct output.
>
> I think that this can be set up such that it looks like nothing has
> changed for the user, while the files containing the correct
> output are no longer needed for the unittest-based tests.
>
> Questions, comments, objections, anybody?

Sounds good to me - and doesn't add any new dependencies either.

Peter



More information about the Biopython-dev mailing list