Data are becoming the new raw material of business
The Economist

Testing Jupyter Notebooks

Christian Moscardi is Director of Technology at The Data Incubator. This was originally posted on his blog and is a follow-up piece to another post on Embedding D3 in IPython Notebook

jupyter-logoJupyter is a fantastic tool that we use at The Data Incubator for instructional purposes. One perk of using Jupyter is that we can easily test our code samples across any language there’s a Jupyter kernel for. In this post, I’ll show you some of the code we use to test notebooks!

First, a quick discussion of the current state of testing ipython notebooks: there isn’t much documented about the process. ipython_nose is a really helpful extension for writing tests into your notebooks, but there’s no documentation or information about easy end-to-end testing. In particular, we want the programmatic equivalent of clicking “run all cells”.After poking around things like github’s list of cool ipython notebooks and the Jupyter docs, two things became apparent to us:

  1. Most people do not test their notebooks.
  2. Automated end-to-end testing is extremely easy to implement. Continue reading
Tweet about this on TwitterShare on FacebookShare on LinkedIn