We are planning to add an integration test to our Jupyter notebooks to verify that they run end-to-end by using pytest and the nbval plugin.
One feature that we would like to have is the ability to parametarize notebook executions, so that we can try different values for variables in the Jupyter notebook cells and effectively test multiple scenarios for the same notebook.
E.g.
foo = 1
print(foo)
We would like to be able to assign any value like 1,2,3,100,900, etc to foo and see the output of execution. Essentially something like:
<EXECUTE_NOTEBOOK> -p foo=2
<EXECUTE_NOTEBOOK> -p foo=3
<EXECUTE_NOTEBOOK> -p foo=4
<EXECUTE_NOTEBOOK> -p foo=100
<EXECUTE_NOTEBOOK> -p foo=900
and see the different outputs.
We know that papermill already supports something like this: https://papermill.readthedocs.io/en/latest/usage-execute.html#execute-via-the-python-api
Does pytest have a feature like this as well?