<br><br><div class="gmail_quote">On Wed, May 16, 2012 at 7:01 PM, Fabrice Silva <span dir="ltr"><<a href="mailto:silva@lma.cnrs-mrs.fr" target="_blank">silva@lma.cnrs-mrs.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">> maybe it's this<br>
> <a href="http://thread.gmane.org/gmane.comp.python.numeric.general/49785/focus=49787" target="_blank">http://thread.gmane.org/gmane.comp.python.numeric.general/49785/focus=49787</a><br>
</div>Thanks for your reply, Not sure it is the same trouble, I'll have a<br>
deeper look at that thread...<br>
<div class="im"><br></div></blockquote><div><br>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.<br>
<br>Ralf<br><br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">
> It helped in my case, and I don't have a problem running the tests<br>
> with your mypackage (using my patched numpy)<br>
<br>
</div>What I get:<br>
$ python -c "import mypackage; mypackage.test(coverage=False, verbose=10)"<br>
Reading a.py file...<br>
Id(mycls in b) = 168022116<br>
Running unit tests for mypackage<br>
NumPy version 1.6.2rc1<br>
NumPy is installed in /usr/lib/pymodules/python2.7/numpy<br>
Python version 2.7.3rc2 (default, Apr 22 2012, 22:35:38) [GCC 4.6.3]<br>
nose version 1.1.2<br>
[...]<br>
test_a.test_instantition ... Id(type(self)) = 168022116<br>
Id(type(obj)) = 168022116<br>
ok<br>
<br>
----------------------------------------------------------------------<br>
Ran 1 test in 0.002s<br>
<br>
OK<br>
$ python -c "import mypackage; mypackage.test(coverage=True, verbose=10)"<br>
Reading a.py file...<br>
Id(mycls in b) = 143573092<br>
Running unit tests for mypackage<br>
NumPy version 1.6.2rc1<br>
NumPy is installed in /usr/lib/pymodules/python2.7/numpy<br>
Python version 2.7.3rc2 (default, Apr 22 2012, 22:35:38) [GCC 4.6.3]<br>
nose version 1.1.2<br>
[...]<br>
Reading a.py file...<br>
Id(mycls in b) = 150640036<br>
test_a.test_instantition ...<br>
Id(type(self)) = 150640036<br>
Id(type(obj)) = 150640036<br>
FAIL<br>
<br>
======================================================================<br>
FAIL: test_a.test_instantition<br>
----------------------------------------------------------------------<br>
Traceback (most recent call last):<br>
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest<br>
self.test(*self.arg)<br>
File "/tmp/cover/mypackage/tests/test_a.py", line 13, in test_instantition<br>
assert a.b.is_mycls(obj)<br>
AssertionError<br>
<br>
[coverage results]<br>
Ran 1 test in 0.006s<br>
<br>
FAILED (failures=1)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
--<br>
Fabrice Silva <<a href="mailto:silva@lma.cnrs-mrs.fr">silva@lma.cnrs-mrs.fr</a>><br>
LMA UPR CNRS 7051<br>
<br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br>