respec / HSPsquared

Hydrologic Simulation Program Python (HSPsquared)
GNU Affero General Public License v3.0
43 stars 17 forks source link

Advanced Model validation tests #143

Closed rburghol closed 1 month ago

rburghol commented 3 months ago

Overview

Develop specific performance (accuracy, and/or efficiency) testing of hsp2 model runs. Extends work #135

Tasks:

Code

Install pytest etc.

pip install -e .[dev] # make sure test dependencies are installed
pip install pytest-xdist # allow running tests in parallel
pip install pytest-cov # permit more verbose/detailed tests

Compare Outputs from test10.uci and test10specl.uci

Basic testing in HSPsquared/tests/ (from @PaulDudaRESPEC @austinorr)

Very simple pytest

def test_h5_file_exists(): assert os.path.exists('test10.h5')

This shows how how to break the test

def test_that_should_fail(): assert os.path.exists('nonexistent_h5_file.h5')