[IPython-dev] nosebook: notebooks-as-documentation-as-tests

Nicholas Bollweg nick.bollweg at gmail.com
Sat Feb 14 20:22:17 EST 2015


Yeah i didn't enable any replacements by default, though tracebacks are
stripped, as they are easy to find in the comms. There are examples in the
tests, but i probably need to document those main edge cases better.
On Feb 14, 2015 7:28 PM, "Thomas Kluyver" <takowl at gmail.com> wrote:

> Thanks for this, Nicholas - there has been quite a bit of discussion about
> having something like doctest for notebooks, so it's great to see an
> implementation.
>
> I imagine the tricky bit will be deciding which bits of output are
> changeable and should be ignored. I think doctest recognises three things
> that are allowed to vary:
>
> - <foo at 0x4fce2...> reprs
> - Python tracebacks
> - ... ellipsis to explicitly mark variable sections (this might need an
> extra option enabled, I forget)
>
> Best wishes,
> Thomas
>
> On 14 February 2015 at 14:55, Nicholas Bollweg <nick.bollweg at gmail.com>
> wrote:
>
>> Just wanted to plug a little nose extension that I've just gotten working:
>>
>> https://github.com/bollwyvl/nosebook
>>
>> nosebook finds notebooks that look like tests, and for each notebook,
>> starts a kernel, runs the code cells and compares the output to what was in
>> the original notebook. It can be configured to find different notebooks, as
>> well as strip out nasty <xyz at 0x1234> bits.
>>
>> It's not a full nose/notebook integration, as it lacks lots of features
>> like setup and teardown, but should make it easier to keep documentation in
>> notebooks fresh with respect to code changes.
>>
>> It reuses IPython.kernel.tests.util, which is probably not the best
>> long-term solution, as that probably isn't meant as a public API, but it
>> was the quickest way to get it up and running. Right now it's not backward
>> compatible with IPython 2.x, but that might be added if there is outcry.
>>
>> Interested in feedback!
>>
>> _______________________________________________
>> IPython-dev mailing list
>> IPython-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>>
>>
>
> _______________________________________________
> 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/20150214/d1af1f74/attachment.html>


More information about the IPython-dev mailing list