Skip to main content

a nose plugin for IPython notebooks

Project description

nosebook
========

a `nose <http://nose.readthedocs.org/>`__ plugin for finding and running
IPython 3 notebooks as nose tests.

You can use it to decrease the burden of documentation and testing by
making a single set of notebooks into both rich documentation and a part
of your test suite, with certain limitations.

|Build Status|

.. |Build Status| image:: https://travis-ci.org/bollwyvl/nosebook.svg?branch=master
:target: https://travis-ci.org/bollwyvl/nosebook

How does it work?
-----------------

Each notebook is started with a fresh kernel, based on the kernel
specified in the notebook. If the kernel is not installed, no tests will
be run and the error will be logged.

Each ``code`` will be executed against the kernel in the order they
appear in the notebook: other cells e.g. ``markdown``, ``raw``, are just
ignored.

The output has to **match exactly**, with the following parts of the
output stripped:

- execution numbers, i.e. ``[1]:``
- tracebacks

This can be a problem, such as with class ``_repr_`` methods that
include the memory location of the instance, so care should be taken
with non-deterministic output.

Configuring ``nosetests`` to use ``nosebook``
---------------------------------------------

These options can be specified in your `nose config file <./.noserc>`__,
or as long-form command line arguments, i.e. ``--with-nosebook``.

``with-nosebook``
^^^^^^^^^^^^^^^^^

``nosetests`` will look for notebooks that seem like tests, as
configured with ```nosebook-match`` <#nosebook-match>`__.

*Default: False*

.. code:: python

# Basic usage
!nosetests --with-nosebook
``nosebook-match``
^^^^^^^^^^^^^^^^^^

A regular expression that tells nosebook what should be a testable
notebook.

*Default: ``.*[Tt]est.*.ipynb$``*

.. code:: python

# Run against all notebooks... probably not a good idea
!nosetests --with-nosebook --nosebook-match .*.ipynb
``python setup.py test`` integration
------------------------------------

Strangely complex, see the example in ```setup.py`` <./setup.py>`__.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nosebook-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

nosebook-0.1.0-py2.py3-none-any.whl (5.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file nosebook-0.1.0.tar.gz.

File metadata

  • Download URL: nosebook-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for nosebook-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b1c63ba3c06cb3c30411ac2a89ee0a57f3e770ac6e206d47e3220927a30fe41
MD5 0973e26f5e620532d40a36165f6a1b1e
BLAKE2b-256 5958fbdede6c28eaa37035d0a224c37d32bf99a98edb57979fe0d85780ae14a5

See more details on using hashes here.

File details

Details for the file nosebook-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for nosebook-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c679320a620e3b37b07f1631935282fe78965b131581c4b4315af24249af42b0
MD5 d364cfb23034d18675beedc3f0f07352
BLAKE2b-256 fb55ad70b283881ba1caeb3cbb9b40d7563d99e59be0fb6de89d80c1dfc1474f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page