jupyter lab:
testing notebooks
Jupyterlab is an amazing environment to play around in. There are some features that can make the experience even better. A collection of them will be demonstrated here.
Notes
Be sure to install the dependencies first. You can do this from the terminal but be sure that you're in the correct virtual environment.
pip install pytest nbval
The commands that were used in this video are listed below.
Base Starter
pytest --nbval demo.ipynb
If you want to disable the warnings
pytest --nbval --disable-warnings demo.ipynb
If you don't care about cell outputs
pytest --nbval-lax --disable-warnings demo.ipynb
If you want the command line tool to ignore a cell simply add this comment to it;
# NBVAL_RAISES_EXCEPTION
Feedback? See an issue? Something unclear? Feel free to mention it here.
If you want to be kept up to date, consider signing up for the newsletter.