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

pytest-nbsmoke

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.

In particular, this extension is supposed to handle ipython magics as far as possible, but has not yet been widely tested.


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

Requirements

  • pytest>=3.1.1

  • jupyter_client

  • ipykernel

  • nbformat

  • nbconvert

  • pyflakes

Installation

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

$ pip install pytest-nbsmoke

Usage

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-run notebooks/Untitled*.ipynb

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

[pytest]
# when running, seconds allowed per cell (see nbconvert timeout)
cell_timeout = 600

# notebooks to skip running; one case insensitive re to match per line
skip_run = ^.*skipme\.ipynb$
           ^.*skipmetoo.*$

# case insensitive re to match for file to be considered notebook;
# defaults to ``^.*\.ipynb``
it_is_nb_file = ^.*\.something$

Contributing

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

New release to PyPI: git tag -a x.y.z -m "Something about release" && git push --tags.

License

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

Issues

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.

Source Distribution

pytest-nbsmoke-0.1.4.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_nbsmoke-0.1.4-py2.py3-none-any.whl (7.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pytest-nbsmoke-0.1.4.tar.gz.

File metadata

File hashes

Hashes for pytest-nbsmoke-0.1.4.tar.gz
Algorithm Hash digest
SHA256 040a7558f5ec35486ff1d7815d7eccdbf37bc3309d5adf0922c3433e102ed78d
MD5 a010cbd92638ac701b9a98c0c9c44dc2
BLAKE2b-256 fd7b6eaa519ba69d0406751e3e1c7e4b3fec456e6cc01c19e36479759aab3063

See more details on using hashes here.

File details

Details for the file pytest_nbsmoke-0.1.4-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_nbsmoke-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4436b2b2d0d33d967fd9864e5fc30c510a0fa81452c55994f2c9de71426d8974
MD5 3e17b52d3664dd63d549097a3a9327d6
BLAKE2b-256 cb7f903387a2af5e1bae9b91055ce08e962d314d657728c19768471b9613c6f4

See more details on using hashes here.

Supported by

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