HARPgroup / HSPsquared

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

tests for spec actions #100

Closed austinorr closed 5 months ago

austinorr commented 5 months ago

make sure test dependencies are installed with pip install -e .[dev]

run tests in parallel by installing pytest-xdist via pip install pytest-xdist

run test10 and test10specl in parallel with pytest -k test_case -n 2 and both should pass.

try them again in series though, pytest -k test_case and the second one will fail due to shared mutable state in the session.

rburghol commented 5 months ago

Thanks @austinorr btw this:

tests/**/*.h5

is a super smart approach to excluding just testing h5s.

austinorr commented 5 months ago

I noticed there are a bunch of peoples personal test files listed in the gitignore, so now there’s also a prefix that works on any file or folder that starts with “_no_git*”. Now we don’t need to change the gitignore file everytime a contributor tries something, they can just rename their testing files or directory with the prefix.