[Biopython-dev] run_tests.py rewrite

Michiel de Hoon mjldehoon at yahoo.com
Tue Feb 3 06:52:05 EST 2009


> However, this way, test_docstring will be difficult to
> mantain in the future.
> A better solution would be to have run_test.py go through
> all biopython's modules, and then execute every doctest it
> encounters.
> You can do this with doctest.DocTestFinder (have a look at
> nose's code, which does it already:

Can doctest.DocTestFinder handle missing external dependencies? For example, if a user installed Biopython without NumPy, then the NumPy-dependent modules should be skipped and not flagged as errors.

> Moreover, why the typical user should be running
> biopython's tests?

To make sure that it works. Biopython interacts with and therefore depends more on 3rd party software, web servers, and file formats than most other Python modules. Things are more likely to break than for example for a more self-contained library such as NumPy. I always run the Biopython tests, and I would advise every user to do so too. In addition, the tests can function as example scripts showing how to use Biopython. It is important that all users can run those scripts.

> What about having support to global fixtures?
> For example, many test scripts begin in the same way: they
> 'import
> numpy', check for python's version, etc.. All of
> this could be moved
> to a global fixture and then executed only once for all the
> tests.

Hmm... currently the Biopython tests can be written essentially independently of each other, without knowing much about the testing overall framework. I think that that makes it easier for new users/developers to add tests. I think we should avoid the situation that somebody first has to study Biopython's testing framework to be able to add a test.

--Michiel.


      


More information about the Biopython-dev mailing list