Basic notebook checks. Do they run? Do they contain lint?
Project description
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.
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.
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] 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)
Contributing
First, install using pip install -e .. Then run the tests using tox or pytest -v tests/.
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
Built Distribution
File details
Details for the file pytest-nbsmoke-0.1.0.tar.gz
.
File metadata
- Download URL: pytest-nbsmoke-0.1.0.tar.gz
- Upload date:
- Size: 27.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e559b30f15c4a06d502ba2f0d43d205ffe108aa5697667e6c93bf6385ae2af0b |
|
MD5 | e6bc9d3dff062ff6b72b7191d42430a1 |
|
BLAKE2b-256 | a445c9ec97dc27462cf17add25093cc5bf06509f35158e7c13b5ef27f2839ba8 |
File details
Details for the file pytest_nbsmoke-0.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pytest_nbsmoke-0.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4111a5881b7468ea990b412e89a6152372b7494cf2cc181b493ce2194e29b453 |
|
MD5 | 5b135b1bff23734cd2cd531170edef13 |
|
BLAKE2b-256 | 8faae80f5fbdf29f0b4b6a3e93771725c4a9282585cb64d43c57849fd5351f03 |