eftsung / pygr

Automatically exported from code.google.com/p/pygr
0 stars 0 forks source link

add pygrtest_common import to all primary tests #19

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
nolleyal's patch to add pygrtest_common to all primary tests.

pygrtest_common is an import common to the five primary test files
(blast_test, graph_test, nlmsa_test, pygrdata_test, and sequence_test).
It allows stock to be run before (or after) each test.

This is in support of two goals: first, adding code coverage analysis to
the tests; and second, adding an import path requirement.

The first goal is to analyze the code coverage of the current tests over
the pygr code base, in the interests of identifying areas that aren't
executed by the current tests.  Because 'protest' runs each test in its
own process (necessary for some tests, e.g. the pygr.Data tests) we
cannot run figleaf just on protest.py; it needs to be run for each of
the test cases.  We decided the best way to do this was to turn it on in
a common file which is imported by each test module.

Note that pygrtest_common only turns on figleaf code coverage recording
in test modules if it was on in protest.py; this is communicated by
using an environment variable.

The second goal of having a common import was to add an import path
mod & check to make sure that the tests are importing the development
version of pygr.  This removes the need to set PYTHONPATH and also
overcomes problems with some versions of easy_install, where the
installed egg is imported despite PYTHONPATH settings.  It also makes
it possible to "just run" the tests and be fairly confident that the
development tree is the version being tested.

The patch correctly looks for pygr in both the pygr/ directory and the
build/lib.$PLATFORM directory, so you can use either

   python setup.py build_ext -i

or

   python setup.py build

to compile pygr before running the tests.

Original issue reported on code.google.com by the.good...@gmail.com on 21 Jun 2008 at 8:57

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by the.good...@gmail.com on 22 Aug 2008 at 4:55

GoogleCodeExporter commented 8 years ago

Original comment by mare...@gmail.com on 21 Feb 2009 at 2:03

GoogleCodeExporter commented 8 years ago
Superseded by issue #65, Istvan's rewrite of the unit tests.

Original comment by the.good...@gmail.com on 1 Mar 2009 at 3:45