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

Peter Cock p.j.a.cock at googlemail.com
Thu Jan 31 09:26:50 EST 2013


On Thu, Jan 31, 2013 at 1:46 PM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
>> 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.

I can see how that would work - put all the path changing magic into
run_tests.py (before running the doctest for Bio/x/y/z.py change to
the directory Bio/x/y and so on), and have the Bio/x/y/z.py doctests
assume they will be run from Bio/x/y only.

> 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.

Of course.

> 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.

Many of the unittests and doctests currently use the same example files.

However, my main objection is that I don't like the idea of putting test files
under Bio/* - I feel it should be the source code only (bar some special
cases like data files). There are probably packaging guidelines about this
somewhere... but I can't find anything immediately.

Regards,

Peter


More information about the Biopython-dev mailing list