[IPython-User] Doctest checker in IPython notebook

Catherine Devlin catherine.devlin@gmail....
Fri Nov 2 05:29:43 CDT 2012

Thanks, everybody!  After a bunch of tweaking to get it to work as a
decorator, I uploaded to PyPI:


I'd be happy to work toward inclusion in IPython itself, of course! - and
I'm open to suggestions about what else should be done to make that
possible.  I do want to let it take an argument so that you can decorate
with @test(show_successes=True) to get each successful example reported
even in an overall test success, or @test(show_successes=false) to never
say anything about tests that succeed (like doctest itself).  But my first
pass at implementing that failed, and I wanted to get this out there.

I plan to keep ipython_doctester as a separate project in addition to
possible future IPython inclusion, because I do want a version that
automatically uploads each test result to an instructor's dashboard... and
that's clearly outside the scope of IPython itself.

On Thu, Oct 11, 2012 at 12:40 PM, Brian Granger <ellisonbg@gmail.com> wrote:

> Catherine,
> Hi, this looks really great!  We would love to work with you to make
> this an actual IPython library or extension.  If you are interested in
> working with us, let's use this thread to discuss where you see this
> heading and the best way to incorporate it into the project.  Of
> course, feel free to continue to work on this on your own as well.
> Cheers,
> Brian
> On Thu, Oct 11, 2012 at 8:34 AM, Thomas Kluyver <takowl@gmail.com> wrote:
> > I spotted this on Planet Python. Catherine Devlin (CCed) has made a
> > tool to doctest a function and display the results in a nice HTML
> > format, for use with the notebook:
> >
> >
> http://catherinedevlin.blogspot.co.uk/2012/10/im-increasingly-amazed-at-ipython.html
> >
> > In the discussion recently about teaching with the notebook, we
> > mentioned the possibility of homework notebooks where the student has
> > to fill in code, so something like this could be really useful.
> >
> > I wonder if there's a better way than using doctests, though (doctests
> > being my pet hate)? It would be easy to define a list of input/output
> > pairs, but all the tuples involved would make writing the tests
> > awkward. Maybe a cell magic:
> >
> > %%check_cases
> > cube(3) == 27
> > cube(-2) == -8
> >
> > Thomas
> > _______________________________________________
> > IPython-User mailing list
> > IPython-User@scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-user
> --
> Brian E. Granger
> Cal Poly State University, San Luis Obispo
> bgranger@calpoly.edu and ellisonbg@gmail.com

- Catherine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20121102/d26f62a2/attachment-0001.html 

More information about the IPython-User mailing list