[IPython-dev] Test failures

Fernando Perez fperez.net at gmail.com
Tue Aug 12 01:11:54 EDT 2008


On Mon, Aug 11, 2008 at 10:06 PM, Gael Varoquaux
<gael.varoquaux at normalesup.org> wrote:

> I tried, but ipapi.get() returns None.

Ah, I thought you were already running with the ipdoctest plugin
installed/enabled, and not with just plain nose.  That plugin starts
up the ipython testing machinery, and it's the only way to actually
run the existing docstrings as tests.  I haven't advertised much how
to use it yet because it's pretty raw, but since you're fighting in
the frontlines, might as well give you a gun :)

For now, you can use the makefile.  Go to the testing/plugin
directory, edit the PREFIX at the top to whatever you like on your
box, and run

make all

That should run the test suite for you after installing the plugin.
Once that's working, you can use the plugin to run your tests as well
with the command line as defined in the $(NOSE) variable atop the
makefile.

The plugin makes an ipython instance for all  tests, so once it's up
and running (which you get by simply saying --with-ipdoctest at your
nose command line), ipapi.get() in *your* code should then always
return an actual ip instance instead of None.

>> Note that with all  the i/o capturing that doctest/nose do, this could
>> get ugly in a hurry, if you're also trying to do your own i/o
>> trapping.  So no guarantees that this will actually work.
>
> Indeed, and I am trying to test this. But this part works. What doesn't
> work is that when and ipython0 instance is instanciated, the output
> trapping that you are doing in the ipython1 interpreter is broken. And I
> happen to need an ipython0 instance to run the frontend I am trying to
> test.
>
> This is a bit frustrating. I have a set of tests for this frontend, but I
> can't run them through nose, because they cause side effects and have
> another test to fail. The side-effect is quite clearly in something
> called by make_IPython, but I am having a hard time figuring out where.

Yes, I'm sorry you're seeing this.  This particular battle isn't going
to be fun, and we're paying the price of neglecting testing for such a
long time.  But we all know it's the right thing to do, and I really
appreciate your commitment despite how unpleasant it is.

Cheers,

f



More information about the IPython-dev mailing list