[IPython-dev] Test failures

Gael Varoquaux gael.varoquaux@normalesup....
Tue Aug 12 00:06:20 CDT 2008


On Mon, Aug 11, 2008 at 09:37:36PM -0700, Fernando Perez wrote:
> > But, I don't get it. I need to create an ipython0 instance, not to
> > retrieve an existing one. This is pretty-much the entry point of my
> > frontend: to create an ipython0 instance. I don't see how ipapi.get can
> > help me on that. I actually don't see how I can do it without
> > make_IPython. If you have something better to suggest, I am happy to use
> > it.

> But this is during the test suite, right?  In that case, it's going to
> be a little tricky, I suspect, because the testing plugin already has
> to make an ip0 instance so magics and other similar beasts run.

> Could you make your class take optionally the ip0 instance as a
> parameter at construction time?  This isn't very elegant, but it may
> do for now so you can run in the testing environment until we can fix
> it to decouple all the global effects.

> In that case, you'd run your constructor passing it the ip0 instance
> retrieved from ipapi.get(), and work with that.

I tried, but ipapi.get() returns 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.

Gaël


More information about the IPython-dev mailing list