OCHA-DAP / pa-anticipatory-action

Code and documentation for analytical work on OCHA Anticipatory Action pilots.
GNU General Public License v3.0
14 stars 0 forks source link

Unit tests #137

Closed turnerm closed 3 years ago

turnerm commented 3 years ago

Add unit tests, particularly focusing on:

Tinkaa commented 3 years ago

Also for ecmwf see #84

mcarans commented 3 years ago

I would suggest using pytest for unit testing as it offers a superset of features available in the basic unit testing of Python. Its assert x == y form is easier to read than self.assertEquals(x, y) and it has some nice fixtures and monkey patching features among other things. eg. https://github.com/OCHA-DAP/hdx-python-utilities/blob/master/tests/hdx/utilities/test_dateparse.py https://github.com/OCHA-DAP/hdx-python-utilities/blob/master/tests/hdx/utilities/test_path.py

mcarans commented 3 years ago

A standard Python setup for running flake8 linting and tests in GitHub Actions with coverage sent to coveralls.io is: https://github.com/OCHA-DAP/hdx-data-freshness/blob/master/.github/workflows/run-python-tests.yml

turnerm commented 3 years ago

To be addressed in hackathon