fortran-lang / fprettify

auto-formatter for modern fortran source code

Home Page:https://pypi.python.org/pypi/fprettify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update testing framework

gnikit opened this issue · comments

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

  • allows for parallel runs e.g. pytest -n 8
  • easier to maintain. The existing way we call the unittests is deprecated and swapping to python -m unittests does not show the output we would want for debugging

WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox

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).

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.