[Numpy-discussion] [numpy.testing] re-import when using coverage
silva at lma.cnrs-mrs.fr
Wed May 16 11:05:48 EDT 2012
I am getting into troubles when using numpy.testing with coverage. A
minimal example package is atached to this email. Unpack and run:
$ python -c "import mypackage; mypackage.test(verbose=10,coverage=False)"
$ python -c "import mypackage; mypackage.test(verbose=10,coverage=True)"
This package contains two module files, one of them (b.py) defining a
class (mycls), the other one (a.py) importing the first module. I then
add a simple test file, that does instantiate the class through the
other module (a.py) and checking the type of the resulting object
Without coverage, everything is ok. With coverage, I got a
(unexpected ?) reload of the modules, leading to a mismatch of types...
The real case is somewhat more complicated, and I would prefer to keep
the instantiation through a.py. Is there a way to solve the problem ?
Fabrice Silva <silva at lma.cnrs-mrs.fr>
LMA UPR CNRS 7051
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 10240 bytes
Desc: not available
More information about the NumPy-Discussion