FiniteVolumeTransportPhenomena / PyFVTool

Finite volume toolbox in Python
GNU Lesser General Public License v2.1
13 stars 4 forks source link

Testing #12

Closed mhvwerts closed 9 months ago

mhvwerts commented 1 year ago

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

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:

simulkade commented 1 year 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.

mhvwerts commented 1 year ago

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.

mhvwerts commented 1 year ago

To do:

mhvwerts commented 1 year ago

To do:

mhvwerts commented 10 months ago

pytest is now functional (#22 )

See comments in pytest.ini for indications on setting up testing environment.