check doctests using pytest
The current code already has many doctests in the functions docstrings. pytest has convenient methods to execute and check doctests:
python3 -m pytest --doctest-modules
unfortunately, all of the currently available tests fail. The tests (and code) should be checked and fixed. Future commits should be checked automatically e.g. using Gitlab CI. A potential .gitlab-ci.yml
could look like:
pytest:
image: "python:3.10"
stage: test
before_script:
- pip install -r requirements.txt
- pip install pytest
script:
- pytest --doctest-modules --junitxml=report.xml
artifacts:
when: always
reports:
junit: report.xml
requirements.txt
. Maybe a better option would be to install the moist_thermodynamics
package instead of using requirements.txt
, maybe @m300575 knows how to do that the most elegant way :-)
Edited by Tobias Koelling