BAMresearch / probeye

A general framework for setting up parameter estimation problems.
MIT License
5 stars 5 forks source link

unittest and/or pytest? #41

Closed rozsasarpi closed 2 years ago

rozsasarpi commented 2 years ago

The tests in the tests folder all seem to use unittest but the GitHub action pipeline uses pytest. Is this intentional?

TTitscher commented 2 years ago

Running unittests with pytest is an intentional feature :)

History: When I started coding in python, I used unittest mainly because it is in the standard library and somehow stuck to it. Over time though, I swapped to pytest to run the tests. If I remember correctly, that was because of its nice integration with codecov. And we somehow copied that approach to probeye.

But note that I have no strong preferences, all frameworks seem to cover the simple (mainy assert true and assert almost equal and no mocking etc) tests.

rozsasarpi commented 2 years ago

Thanks for the explanation. Is it preferred to add new tests using unittest to keep things consistent or it is ok to mix in pytest? I find the unittest approach verbose with its classes.

aklawonn commented 2 years ago

Personally, I don't mind if you write new tests in pytest (we just have to add it in the setup.cfg). I just adapted the unittest-approach from our previous BayesianInference package.

rozsasarpi commented 2 years ago

pytest is already a dependency in setup.cfg :) https://github.com/BAMresearch/probeye/blob/034ff1ae05943400cdc9c228101303c3ce8a1806/setup.cfg#L36