[Numpy-discussion] [numpy.testing] re-import when using coverage

Ralf Gommers ralf.gommers at googlemail.com
Thu May 17 04:34:14 EDT 2012

On Thu, May 17, 2012 at 9:48 AM, Fabrice Silva <silva at lma.cnrs-mrs.fr>wrote:

> Le mercredi 16 mai 2012 à 22:58 +0200, Ralf Gommers a écrit :
> > Both coverage=True and coverage=False work with your attached package.
> > But it seems you attached an old version, because test_a.py doesn't
> > include the actual test. "obj = a.b.mycls()" in test_a.py executes
> > fine, so it may be a problem with the way you wrote the test case.
> Sorry, I forgot to update the archive...
> Here new one that lead (on my machine) to failure with coverage

Still not the right code.

Here's the code in b.py:

class mycls(object):
    def __init__(self):
        print "Id(type(self)) = ",id(type(self))
print "Id(mycls in b) = ", id(mycls)

Test fails on "assert a.b.is_mycls(obj)".  There's no such thing in b. This
has nothing to do with coverage.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120517/b56092b3/attachment.html>

More information about the NumPy-Discussion mailing list