Basic notebook checks. Do they run? Do they contain lint?
Project description
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.
Installation
You can install “nbsmoke” via pip from PyPI:
$ pip install 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, “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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for nbsmoke-0.1.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b55b0631a33ec178833a65d79e39aca46a2fe4dd78ae93d0ae63ea48943105 |
|
MD5 | c2303e9a4a6659b116f63436a9b67ddd |
|
BLAKE2b-256 | a0dba9c265e034d0329faad50603f2cea18761b08021fdeadd161ea4b1bf5dbb |