[IPython-user] unittest'ing in iPython

Alexander Schmolck a.schmolck at gmx.net
Fri May 13 13:19:30 CDT 2005


Fernando Perez <Fernando.Perez at colorado.edu> writes:

> danny shevitz wrote:
>> Howdy,
>> I'm an IPython newbie, although an experienced python user. I tried
>> searching the archives, but this is too frustrating being archived by
>> month. Is there a fully searchable archive? BTW I'm running on Win2K,
>> python 2.3.4, ipython 0.6.13.
>> Here's the question: I use unittest'ing extensively. I want to unittest
>> under IPython. If there is an exception I want to drop into the
>> debugger at the point of that exception. The problem is that the
>> unittesting framework catches all exceptions and deals with them
>> nicely. Is there any way to enter the debugger if something fails in my
>> unit tests? I have been trying the %run command, but to no avail.
>
> For this one, I'm not sure, but perhaps Alex's suggestions/code did help.

I got a private reply by the last user who asked; he said that he found out
that it was also possible to use TestCase's .debug method but that he was
still going to give the code I posted a try, because it also allows you to
restart at the last failure (which is quite timesaving if you're developing
with a large and expensive testsuite).


'as




More information about the IPython-user mailing list