A unit testing framework for Jupyter Notebooks
WARNING: This is the old package name
nteract-testbook -- please install
testbook in the
future as no new releases are going out for this old package name.
testbook is a unit testing framework extension for testing code in Jupyter Notebooks.
Previous attempts at unit testing notebooks involved writing the tests in the notebook itself. However, testbook will allow for unit tests to be run against notebooks in separate test files, hence treating .ipynb files as .py files.
testbook helps you set up conventional unit tests for your Jupyter Notebooks.
Here is an example of a unit test written using testbook
Consider the following code cell in a Jupyter Notebook:
def sum(a, b): return a + b
You would write a unit test using
testbook in a Python file as follows:
import testbook @testbook.testbook('/path/to/notebook.ipynb', execute=True) def test_notebook(tb): sum = tb.ref("sum") assert sum(1, 2) == 3
pip install nteract-testbook
See readthedocs for more in-depth details.
Read CONTRIBUTING.md for guidelines on how to setup a local development environment and make code changes back to testbook.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size nteract_testbook-0.1.3-py3-none-any.whl (9.8 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
Hashes for nteract_testbook-0.1.3-py3-none-any.whl