fortran-lang / fprettify

auto-formatter for modern fortran source code
https://pypi.python.org/pypi/fprettify
Other
368 stars 73 forks source link

Update testing framework #136

Open gnikit opened 1 year ago

gnikit commented 1 year ago

The existing unittests framework does not appear to be catching all errors. I propose we swap to pytest for mainly 2 reasons:

pseewald commented 1 year ago

I'm currently revamping the testing mechanism (see #140) because I think it's not maintainable in the current state. I'll switch to pytest after some more cleanup work if it's reasonably easy to do.

After a quick search, I think the deprecated warning comes from the test command of setuptools being deprecated and has nothing to do with the unittest framework. How would switching to pytest help with this?

The existing unittests framework does not appear to be catching all errors

Some tests are expected to fail, for instance if they use old Fortran constructs that are not supported by fprettify. These failures are registered as internal error or parse error in the expected results (https://github.com/pseewald/fprettify/blob/master/fortran_tests/test_results/expected_results).

gnikit commented 1 year ago

How would switching to pytest help with this?

We would not be running python3 setup.py test which causes the warning to be thrown see, instead we would directly call pytest thus removing the warning altogether.

Using pytest is a personal preference, mostly driven by my poor experiences with unittest. If swapping is too much of a pain we can defer this discussion for a later point in time.