This handles a bug in the testing process where running our tests with pytest from the root of the repository would attempt to run the example models in the examples folder.
The test functions and data were all moved into a tests folder under the source root while the offending example scripts were renamed to stay out of pytest's radar. Alongside this fix, a test target for make was also added and a .ini file was added in the root telling pytest to ignore the deprecation and future warnings coming from dependencies (tensorflow in particular).
Pytest's test detection was checked by running it with the -v option, which conveniently makse it print every test name it runs. The output is below, showing that it now only runs the actual tests.
There are also a couple of improvements to the testing. Relative imports and file paths were replaced with absolute versions, and one test had some cases added to it. This has been tested to work on a fresh fetch/pull with Python 3.6.
This handles a bug in the testing process where running our tests with pytest from the root of the repository would attempt to run the example models in the
examples
folder.The test functions and data were all moved into a
tests
folder under the source root while the offending example scripts were renamed to stay out of pytest's radar. Alongside this fix, a test target for make was also added and a.ini
file was added in the root telling pytest to ignore the deprecation and future warnings coming from dependencies (tensorflow in particular).Pytest's test detection was checked by running it with the
-v
option, which conveniently makse it print every test name it runs. The output is below, showing that it now only runs the actual tests.There are also a couple of improvements to the testing. Relative imports and file paths were replaced with absolute versions, and one test had some cases added to it. This has been tested to work on a fresh fetch/pull with Python 3.6.