Skip to main content

Basic notebook checks. Do they run? Do they contain lint?

Project description

See Build Status on Travis CI See Build Status on AppVeyor


Basic notebook smoke tests: Do they run ok? Do they contain lint?

WARNING: early stage proof of concept; work in progress. Use at your own risk.

Created with a cookiecutter and modified until it seemed to work. There’s loads of cleanup left to do (and boilerplate to remove).

This Pytest plugin was generated with Cookiecutter along with @hackebrot’s Cookiecutter-pytest-plugin template.


  • pytest >= 3.1.1
  • jupyter_client
  • ipykernel
  • nbformat
  • nbconvert
  • pyflakes


You can install “pytest-nbsmoke” via pip from PyPI:

$ pip install pytest-nbsmoke


Check all notebooks in examples/ run without errors:

$ pytest --nbsmoke-run examples/

Check all notebooks in examples/ run without errors, and store html to look at afterwards:

$ pytest --nbsmoke-run --store-html=/scratch examples/

Lint check notebooks in examples/:

$ pytest --nbsmoke-lint notebooks/

Instead of all files in a directory, you can specify a list e.g.:

$ pytest --nbsmoke-lint notebooks/Untitled*.ipynb

Additional options are available by standard pytest ‘ini’ configuration in setup.cfg, pytest.ini, or tox.ini:

it_is_nb_file = ^.*\.something$   # case insensitive re to match for file to be considered notebook; defaults to ``^.*\.ipynb``
cell_timeout = 600                # seconds allowed per cell (see nbconvert timeout)


First, install using pip install -e .. Then run the tests using tox or pytest -v tests/.


Distributed under the terms of the BSD-3 license, “pytest-nbsmoke” is free and open source software.


If you encounter any problems, please file an issue (ideally including a copy of any problematic notebook).

Project details

Download files

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

Files for pytest-nbsmoke, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size pytest_nbsmoke-0.1.0-py2.py3-none-any.whl (6.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pytest-nbsmoke-0.1.0.tar.gz (27.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page