Add tests to your notebook using
Base.Test, or your favorite testing framework.
NBTesting.nbtest("Water_Analysis.ipynb")to run the notebook’s code and tests. It will create and execute a file called NBTest_Water_Analysis.jl.
- (Optional) Track this .jl file with git if all tests are successful.
nbtest will mostly run the notebook code as is (similar to NBInclude.jl), but it provides a few ways to control which code gets executed when, and a
verbose=... option for printing the headers (on by default - see
?nbtest for details). The code is wrapped inside a module called
NBTest_[Notebook name], to isolate it from the current environment, and to make it easier to inspect the state of the notebook variables if a test fails.