[IPython-dev] doctesting

Fernando Perez fperez.net@gmail....
Thu Sep 6 14:20:52 CDT 2007


On 9/6/07, Stefan van der Walt <stefan@sun.ac.za> wrote:
> Hi all,
>
> The following works under vanilla Python:
>
> import doctest
> doctest.testfile('HOWTO_DOCUMENT.txt') # file from the numpy rep
>
> Is there an easy way to make it work under IPython, too?

works too:

In [1]: import doctest

In [2]: doctest.testfile('HOWTO_DOCUMENT.txt',module_relative=False)
**********************************************************************
File "HOWTO_DOCUMENT.txt", line 59, in HOWTO_DOCUMENT.txt
Failed example:
    [x + 3 for x in a]
Expected:
    [4,5,6]
    """
Got:
    [4, 5, 6]
**********************************************************************
1 items had failures:
   1 of   2 in HOWTO_DOCUMENT.txt
***Test Failed*** 1 failures.
Out[2]: (1, 2)


It just needs fixes that are in my local copy.  The recent server
downtime led me to a local conflict (Ville and I did overlapping work
since without committing for too long), so I need to clean up before I
can commit.

But I'm very busy right now and can't deal with this, I'm afraid...

I'll try to get to it over the weekend.

Cheers,

f


More information about the IPython-dev mailing list