[IPython-User] Doctest checker in IPython notebook

Aaron Meurer asmeurer@gmail....
Thu Oct 11 18:29:28 CDT 2012

On Thu, Oct 11, 2012 at 1:40 PM, Catherine Devlin
<catherine.devlin@gmail.com> wrote:
> 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.
> Wow, thanks!  Sure!  I mean, I didn't really contribute much beyond
> the concept - the implementation is really primitive (ripping apart
> doctest's printed output and parsing its strings).  If it were going
> to become a real part of IPython, it should probably be a little more
> sophisticated - maybe creating a custom "out" function to pass to
> ``DocTestRunner.run`` so it wouldn't be so fragile, and so it could
> accept some arguments/flags.  Or something like that.  This is my
> first time looking inside doctest.py and I'm just trying to sound
> smart.  :)
> I'd also be interested in ideas about how it can look more
> seamless/transparent to use - can the notebook somehow be set up to
> automatically try to run it against all class and function definitions
> found in any of its cells?  Then again, maybe it shouldn't be too
> transparent - maybe it's good to let students see a little of testing
> in action and that testing is awesome but not magic (though it could
> be %magic).

It depends on how self-motivated the intended audience is, because it
would be easy to cheat the way you have it (just have a bunch of if
cases against the examples given in the doctest).

Aaron Meurer

> --
> - Catherine
> http://catherinedevlin.blogspot.com
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user

More information about the IPython-User mailing list