Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update testing framework #136

Open
gnikit opened this issue Aug 31, 2022 · 2 comments
Open

Update testing framework #136

gnikit opened this issue Aug 31, 2022 · 2 comments

Comments

@gnikit
Copy link
Member

gnikit commented Aug 31, 2022

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

@pseewald
Copy link
Collaborator

pseewald commented Oct 3, 2022

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
Copy link
Member Author

gnikit commented Oct 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants