doctests failing in ipython

The problem is the Out[#] appended to the output. ................................................Out[4]: poly1d([ 1., 2., 3.]) ********************************************************************** File "/usr/lib/python2.5/site-packages/numpy/lib/tests/test_polynomial.py", line 6, in test_polynomial Failed example: p Expected: poly1d([ 1., 2., 3.]) Got nothing Tons of these. Chuck

On Fri, Jul 11, 2008 at 02:11, Charles R Harris <charlesr.harris@gmail.com> wrote:
The problem is the Out[#] appended to the output.
................................................Out[4]: poly1d([ 1., 2., 3.]) ********************************************************************** File "/usr/lib/python2.5/site-packages/numpy/lib/tests/test_polynomial.py", line 6, in test_polynomial Failed example: p Expected: poly1d([ 1., 2., 3.]) Got nothing
Tons of these.
Yes. This is well-known. IPython cannot run doctests in general without modification. This is not a bug in numpy's tests; just an incompatibility between IPython and doctest. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Fri, Jul 11, 2008 at 12:29 AM, Robert Kern <robert.kern@gmail.com> wrote:
Yes. This is well-known. IPython cannot run doctests in general without modification. This is not a bug in numpy's tests; just an incompatibility between IPython and doctest.
Couple of questions: - how are these being run? I'm trying np.test('full',doctests=True) and I get the same Ran 1746 tests in 5.104s FAILED (errors=5) from current SVN. But I don't get any doctest failure. - Does %doctest_mode not help with the error Charles is getting? Cheers, f

On Fri, Jul 11, 2008 at 02:37, Fernando Perez <fperez.net@gmail.com> wrote:
On Fri, Jul 11, 2008 at 12:29 AM, Robert Kern <robert.kern@gmail.com> wrote:
Yes. This is well-known. IPython cannot run doctests in general without modification. This is not a bug in numpy's tests; just an incompatibility between IPython and doctest.
Couple of questions:
- how are these being run? I'm trying
np.test('full',doctests=True)
and I get the same
Ran 1746 tests in 5.104s
FAILED (errors=5)
from current SVN. But I don't get any doctest failure.
- Does %doctest_mode not help with the error Charles is getting?
Probably. I forgot about that. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Fri, Jul 11, 2008 at 1:40 AM, Robert Kern <robert.kern@gmail.com> wrote:
On Fri, Jul 11, 2008 at 02:37, Fernando Perez <fperez.net@gmail.com> wrote:
On Fri, Jul 11, 2008 at 12:29 AM, Robert Kern <robert.kern@gmail.com> wrote:
Yes. This is well-known. IPython cannot run doctests in general without modification. This is not a bug in numpy's tests; just an incompatibility between IPython and doctest.
Couple of questions:
- how are these being run? I'm trying
np.test('full',doctests=True)
and I get the same
Ran 1746 tests in 5.104s
FAILED (errors=5)
from current SVN. But I don't get any doctest failure.
- Does %doctest_mode not help with the error Charles is getting?
Probably. I forgot about that.
The problem might be the old ipython version (8.1) shipped with ubuntu 8.04. Debian is slow to update and I've been trying out ubuntu for 64 bit testing. Chuck

On Fri, Jul 11, 2008 at 1:29 AM, Robert Kern <robert.kern@gmail.com> wrote:
On Fri, Jul 11, 2008 at 02:11, Charles R Harris <charlesr.harris@gmail.com> wrote:
The problem is the Out[#] appended to the output.
................................................Out[4]: poly1d([ 1., 2., 3.]) ********************************************************************** File "/usr/lib/python2.5/site-packages/numpy/lib/tests/test_polynomial.py", line 6, in test_polynomial Failed example: p Expected: poly1d([ 1., 2., 3.]) Got nothing
Tons of these.
Yes. This is well-known. IPython cannot run doctests in general without modification. This is not a bug in numpy's tests; just an incompatibility between IPython and doctest.
I don't think any of the unit tests should be doctests. They look ugly and are hard to read. Second, I didn't used to see the problem. Chuck

On Fri, Jul 11, 2008 at 02:40, Charles R Harris <charlesr.harris@gmail.com> wrote:
On Fri, Jul 11, 2008 at 1:29 AM, Robert Kern <robert.kern@gmail.com> wrote:
On Fri, Jul 11, 2008 at 02:11, Charles R Harris <charlesr.harris@gmail.com> wrote:
The problem is the Out[#] appended to the output.
................................................Out[4]: poly1d([ 1., 2., 3.]) ********************************************************************** File "/usr/lib/python2.5/site-packages/numpy/lib/tests/test_polynomial.py", line 6, in test_polynomial Failed example: p Expected: poly1d([ 1., 2., 3.]) Got nothing
Tons of these.
Yes. This is well-known. IPython cannot run doctests in general without modification. This is not a bug in numpy's tests; just an incompatibility between IPython and doctest.
I don't think any of the unit tests should be doctests. They look ugly and are hard to read.
<shrug> Sometimes, they're the most convenient way to express a bunch of tests, in my opinion. You're welcome to have a differing opinion, but you haven't convinced me to reconsider mine.
Second, I didn't used to see the problem.
When? Exactly what did you run? I don't see this problem with the trunk of numpy (and IPython, incidentally): In [1]: import numpy In [2]: numpy.test() ................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................ ---------------------------------------------------------------------- Ran 1744 tests in 8.595s OK Out[2]: <nose.result.TextTestResult run=1744 errors=0 failures=0> -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Fri, Jul 11, 2008 at 02:50, Robert Kern <robert.kern@gmail.com> wrote:
I don't see this problem with the trunk of numpy (and IPython, incidentally):
Also, nose 0.10.3, which may be part of the solution. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

On Fri, Jul 11, 2008 at 1:52 AM, Robert Kern <robert.kern@gmail.com> wrote:
On Fri, Jul 11, 2008 at 02:50, Robert Kern <robert.kern@gmail.com> wrote:
I don't see this problem with the trunk of numpy (and IPython, incidentally):
Also, nose 0.10.3, which may be part of the solution.
Maybe. Upgrading nose alone didn't help, but going to ipython 0.8.4 did the trick. I think we are going to see a lot of error reports from people using the default versions that come with Ubuntu Hardy, which is, after all, the latest and greatest. Maybe we should ping the Ubuntu people before 1.2 goes out. Chuck
participants (4)
-
Charles R Harris
-
Fernando Perez
-
Keith Goodman
-
Robert Kern