Closed mhvwerts closed 9 months ago
It's a good idea @mhvwerts. Let me do some reading on pytest
first. I did consider writing tests but got occupied with other stuff. Now that I'm switching to PyFVTool
for some other projects, it must be easier to spend some time on it. I know that the current validation tests are working fine with unittest
, but I'm not sure whether it is the most efficient way of managing tests. I'll do some research and experiments and come back to you.
I did notice the tests
folder, but did not try to run unittest
. Apparently pytest
will run unittest
tests 'out-of-the-box': https://docs.pytest.org/en/7.4.x/how-to/unittest.html
I did some initial experimentation with pytest-notebook alone, without integrating it with a pytest
. It seems to work, but I will need to get back to it later.
To do:
To do:
pytest
completes without failurespytest
sees all currently available tests (explicit tests, but also implicit tests)pytest
, pytest_notebook
etc. - see pytest.ini
)pytest
is now functional (#22 )
See comments in pytest.ini
for indications on setting up testing environment.
We should set up some simple automated testing infrastructure instead of testing by manually executing the examples, Notebooks and test scripts.
The test could involve
tests
folder andfvtool_test.py
pytest
may be the suitable tool. I used it once in the past, and even though the documentation looks daunting, I believe it wasn't too hard to set up basic testing, which with hindsight prevented some disastrous code changes in that project, avoided incorrect calculations and arguably saved time.Some additional info: