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.


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-lint 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.2.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

pytest_nbsmoke-0.1.2-py2.py3-none-any.whl (7.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

File hashes

Hashes for pytest-nbsmoke-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8a2c781028500ef5324c2ff9db2fdb130da94b3c1e905fac5c5cfde254a9a86e
MD5 95e3dd097b2eccfb16f29764668c6c0e
BLAKE2b-256 6a248d040c70078534fe093797787e1afa46f4c8a367fb0709782165488b5b20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_nbsmoke-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c11d8934d7ea2359becafb51f62ffde739f7ee4eaa8a1da29f9adfe6f99fe633
MD5 8aa0d8f321a910345a56a15502f946ae
BLAKE2b-256 9784d3934b1f1351169bbf3bc14d06f507043144c70be6c00ef9c3ff833718c1

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