-
Notifications
You must be signed in to change notification settings - Fork 6
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.
- Navigate to the directory that contains the notebook(s) you want to test.
- Enter the directory that contains the code and tests for the relevant notebook(s), which will be labelled
src-<chapter>
. - Find the Python file that contains the code for the notebook(s) you want to test.
- 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.)
- 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.