35
loading...
This website collects cookies to deliver better user experience
ipynb
containing notebooks. Install the dependencies in the requirements.txt file, optionally creating yourself a virtual environment first.pip install nbmake==0.5
➜ pytest --collect-only --nbmake "./ipynb"
================================ test session starts =================================
platform darwin -- Python 3.8.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/a/git/alex-treebeard/semaphore-demo-python-jupyter-notebooks
plugins: nbmake-0.5
collected 3 items
<NotebookFile ipynb/Boggle.ipynb>
<NotebookItem >
<NotebookFile ipynb/Cheryl-and-Eve.ipynb>
<NotebookItem >
<NotebookFile ipynb/Differentiation.ipynb>
<NotebookItem >
============================= 3 tests collected in 0.01s =============================
unrecognized arguments: --nbmake
then the nbmake plugin is not installed. This may happen if your CLI is invoking a pytest binary outside of your current virtual environment. Check where your pytest binary is located with which pytest
to confirm this.➜ pytest --nbmake "./ipynb"
================================ test session starts =================================
platform darwin -- Python 3.8.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/a/git/alex-treebeard/semaphore-demo-python-jupyter-notebooks
plugins: nbmake-0.5
collected 3 items
ipynb/Boggle.ipynb . [ 33%]
ipynb/Cheryl-and-Eve.ipynb . [ 66%]
ipynb/Differentiation.ipynb . [100%]
================================= 3 passed in 37.65s =================================
pytest-xdist
as follows:pip install pytest-xdist
auto
using the following commandpytest --nbmake -n=auto "./ipynb"
kernelspec
field inside the notebook's metadata.execution
object as a sibling to the kernelspec
{
"cells": [ ... ],
"metadata": {
"kernelspec": { ... },
"execution": {
"allow_errors": true,
"timeout": 300
}
}
}
overwrite
flag:pytest --nbmake --overwrite "./ipynb"
pytest --nbmake docs --overwrite --ignore=docs/landing-page.ipynb
"*ipynb"
) which manually overrides pytest's ignore flags.For Commands we will use the following:
checkout
cache restore
pip install -r requirements.txt
pip install nbmake pytest-xdist
cache store
pytest --nbmake -n=auto ./ipynb
For Prologue use the following to configure Python 3:
sem-version python 3.8
Error - No such kernel: 'mycustomkernel'
ipykernel
to install your custom kernel if you are using Python.python -m ipykernel install --user --name mycustomkernel