Skip to content

Test changes on the Sandbox Notebook repository with Pytest

eefaye edited this page Aug 18, 2021 · 2 revisions

When making changes to your branch or fork of the DE Africa Sandbox Notebooks repository, it can be important to test your changes have not adversely affected other files. This may occur where you are editing source files used by multiple notebooks, changing scripts or packages, or moving/deleting files referenced by other files.

The Pytest package can be used to automate testing and ensure repository integrity.

The following instructions are tailored for the Digital Earth Africa Sandbox.

  1. Open Terminal.

  2. Navigate to the folder which contains the files you have edited. Ensure you are on the branch you want to test.

  3. Run

pytest --nbval-lax .

Depending on the Sandbox instance, this could take more than an hour.

  1. Inspect summary to locate failed notebooks and code cells.

Find out more in this article on Python Tests for Jupyter Notebooks.