Skip to content

How do I test a notebook or set of notebooks with Devito implementations?

Rini Banerjee edited this page Sep 11, 2020 · 2 revisions

This page outlines how you can run verification tests for a notebook.

  1. Navigate to the directory that contains the notebook(s) you want to test.
  2. Enter the directory that contains the code and tests for the relevant notebook(s), which will be labelled src-<chapter>.
  3. Find the Python file that contains the code for the notebook(s) you want to test.
  4. Replace the Python code with the Devito implementation. (You can keep the Python code commented out, or create separate functions for the Devito code and replace usages of the Python functions in the tests, until you are sure the Devito code is correct.)
  5. Run the following in the command line:
py.test -s -v <file-name>

This will give you a list of test passes and failures. In the case of failures, it will tell you what has gone wrong in the test, whether this be a compilation error or assertion error.