Skip to main content

Cell-by-cell tests for JupyterLab

Project description

# jupyterlab_celltests Cell-by-cell testing for production Jupyter notebooks in JupyterLab

[![Build Status](https://travis-ci.org/timkpaine/jupyterlab_celltests.svg?branch=master)](https://travis-ci.org/timkpaine/jupyterlab_celltests) [![PyPI](https://img.shields.io/pypi/l/jupyterlab_celltests.svg)](https://pypi-hypernode.com/pypi/jupyterlab_celltests) [![PyPI](https://img.shields.io/pypi/v/jupyterlab_celltests.svg)](https://pypi-hypernode.com/pypi/jupyterlab_celltests) [![npm](https://img.shields.io/npm/v/jupyterlab_celltests.svg)](https://www.npmjs.com/package/jupyterlab_celltests)

# Overview Celltests is designed for writing tests for linearly executed notebooks. Its primary use is for report unit tests.

### “Linearly executed notebooks?” When converting notebooks into html/pdf/email reports, they are executed from top-to-bottom one time, and are expected contain as little code as reasonably possible, focusing primarily on the plotting and markdown bits. Libraries for this type of thing include [Papermill](https://github.com/nteract/papermill), [JupyterLab Emails](https://github.com/timkpaine/jupyterlab_email), etc.

### Doesn’t this already exist? [Nbval](https://github.com/computationalmodelling/nbval) is a great product and I recommend using it for notebook regression tests. But it compares the executed notebook’s outputs to its existing outputs, which doesn’t align well with dynamic reports which might be run everyday with different input/output data.

### So why do I want this again? This doesn’t necessarily help you if your data sources go down, but its likely you’ll notice this anyway. Where this comes in handy is:

  • when the environment (e.g. package versions) are changing in your system

  • when you play around in the notebook (e.g. nonlinear execution) but aren’t sure if your reports will still generate

  • when your software lifecycle systems have a hard time dealing with notebooks (can’t lint/audit them as code unless integrated nbdime/nbconvert to script, tough to test, tough to ensure what works today works tomorrow)

### So what does this do? Given a notebook, you can write mocks and assertions for individual cells. You can then generate a testing script for this notebook, allowing you to hook it into your testing system and thereby provide unittests of your report.

![](https://raw.githubusercontent.com/timkpaine/jupyterlab_celltests/master/docs/demo.gif)

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

jupyterlab_celltests-0.0.3.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file jupyterlab_celltests-0.0.3.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_celltests-0.0.3.tar.gz
Algorithm Hash digest
SHA256 f153e12cccac16689a409b085229d1b5954e4e063bf3fc40d5464ebb453aac5c
MD5 145eaa3019f24a29e2e9e1812fa9c432
BLAKE2b-256 6ef70a55936a94ee6cebdb827d11ababed68bf017c720b4f56a2d43950b59d77

See more details on using hashes here.

Provenance

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