Use pytest's runner to discover and execute tests as cells of IPython notebooks
Project description
Plugin for pytest to run IPython notebooks as unit tests, relies on runipy to interface with the Notebook.
Define unit tests in IPython notebook cells (see example on nbviewer):
Run py.test to execute them:
Example
See the examples/ folder or a preview on nbviewer.
Features
Discover files named test*.ipynb
Run each cell of the notebook as a unit test (just use assert)
First line of each cell is the test name, either as docstring, comment or function name
A cell named fixture* or setup* is run before each of the following unit tests as a fixture
Add SKIPCI to a cell description to skip the test on Travis-CI (checks if the CI environment variable is defined)
IPython notebook kernel is restarted after each test
Each notebook is executed in the folder where the .ipynb file is located
Requirements
Python 2.7+, Python 3.2+
pytest
IPython Notebook 2.0+
Install
$ pip install pytest-ipynb
Credits
Thomas Kluyver for help on the IPython mailing list
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 Distributions
Built Distribution
File details
Details for the file pytest_ipynb-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_ipynb-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/38.5.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59124439103ce7e177701298b90478992f29bebc97b48f26bc2a1641b6018362 |
|
MD5 | b7e7c4a4ab4df550d4d2e8032c376f7b |
|
BLAKE2b-256 | f75de2a3640d2e491bd48af017882fc2a66d804de8730358298735ea2c3ae84a |