[IPython-dev] IPy notebook as simple test system?

MinRK benjaminrk at gmail.com
Thu Dec 5 17:42:35 EST 2013


I wrote a toy script a while ago, to show that this kind of thing is
feasible:

https://gist.github.com/minrk/2620735

-MinRK


On Thu, Dec 5, 2013 at 1:00 PM, Martín Gaitán <gaitan at phasety.com> wrote:

> Hi everybody
>
> I need to add some tests to fortran-magic [1] and I realized that,
> basically, I should test each example in the documentation which is already
> done as a notebook[2] .
>
> So, I got this idea: make a a way to run the code cells of a notebook and
> compare the calculated output against the stored output in the notebook.
>
> Looking for something like this I found [3] and [4], which facilitate the
> use of doctests, but it's not exactly the same. Conceptually, this are also
> doctests, but the main difference with what I imagine is that we don't
> bother writing fake code inside the actual code: No docstrings at all, just
> use the cells we already have.
>
> Of course the comparison should be flexible. Doctest has directives to
> allow ellipsis or normalizations, for example [5]. I think this could be
> simplified with an UI to select the portions of the output that must be
> compared and store this selection as cell metadata.
>
> What do you think?
>
> [1] https://github.com/mgaitan/fortran_magic
> [2]
> http://nbviewer.ipython.org/github/mgaitan/fortran_magic/blob/master/documentation.ipynb
> [3]
> http://catherinedevlin.blogspot.co.uk/2012/10/im-increasingly-amazed-at-ipython.html
> [4] https://github.com/tkf/ipython-doctestmagic
> [5] http://docs.python.org/2/library/doctest.html#directives
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20131205/dd4c4924/attachment.html>


More information about the IPython-dev mailing list