[Biopython-dev] Deprecating Bio.ParserSupport, Bio.Blast.NCBIStandalone

Michiel de Hoon mjldehoon at yahoo.com
Thu Jan 31 13:46:47 UTC 2013


> I don't follow what you are suggesting here. Are you
> suggesting putting test files under Bio/* as well/instead
> or under Tests/* ?

Well the key point is that if we run the doctests from the Tests directory (with run_tests.py), we can change directory to the directory containing the module whose doctests we want to test. Then, if "python somemodule.py" can find the test files, then so can run_tests.py. We'd just need to make sure that the relative paths in somemodule.py are correct with respect to the directory in which somemodule.py resides.

But keep in mind that the unit tests in Tests and the doctests in the modules have different functions. The purpose of the unit tests is to test the Biopython code; the purpose of the doctests is to make sure the docstring examples work. So one could argue that the heavy test files should go under Tests, while simple test files just for the docstring examples should go under Bio/SomeModule.

Best,
-Michiel.

--- On Thu, 1/31/13, Peter Cock <p.j.a.cock at googlemail.com> wrote:

> From: Peter Cock <p.j.a.cock at googlemail.com>
> Subject: Re: [Biopython-dev] Deprecating Bio.ParserSupport, Bio.Blast.NCBIStandalone
> To: "Michiel de Hoon" <mjldehoon at yahoo.com>
> Cc: "Wibowo Arindrarto" <w.arindrarto at gmail.com>, "BioPython-Dev Mailing List" <biopython-dev at biopython.org>
> Date: Thursday, January 31, 2013, 6:43 AM
> On Thu, Jan 31, 2013 at 11:03 AM,
> Michiel de Hoon <mjldehoon at yahoo.com>
> wrote:
> > Dear all,
> >
> > [Michiel wrote:]
> >> Still I would think that there is a better way to
> do this,
> >> and I doubt that we are the first ones who want to
> access
> >> test files with doctests. I can write a short
> message to
> >> comp.lang.python to see have anybody has any
> suggestions.
> >
> > So I started writing a message to comp.lang.python, and
> while reading
> > the doctest documentation to make my message
> understandable I
> > realized that we can solve our problem by using the
> setUp and tearDown
> > arguments to doctest.DocTestSuite. Then we put the test
> files in the same
> > directory as the module we want to test, and use
> setUp/tearDown to let
> > the unittest switch to this directory when needed.
> >
> > This has the added benefit that the example files are
> easier to find
> > for users who want to try out a doctest example.
> >
> > Perhaps we'll still run into some issues if we try to
> implement this, but
> > it seems a step in the right direction.
> 
> I don't follow what you are suggesting here. Are you
> suggesting putting
> test files under Bio/* as well/instead or under Tests/* ?
> 
> Peter
> 



More information about the Biopython-dev mailing list