Switch to pytest and add optional Python 3.8 test#380
Switch to pytest and add optional Python 3.8 test#380murrayrm merged 12 commits intopython-control:masterfrom
Conversation
1 similar comment
|
For some reason the Without the |
a03ea58 to
53202aa
Compare
|
Rebased changes on top of master to get some of the fixes from #366 the eased precision on some of the tests. |
| script: | ||
| - 'if [ $SLYCOT != "" ]; then python -c "import slycot"; fi' | ||
| - coverage run setup.py test | ||
| - coverage run -m pytest --disable-warnings control/tests |
There was a problem hiding this comment.
is --disable-warnings needed? I would rather have them printed and give every contributor the opportunity to fix problems early before e.g. DeprecationWarnings turn into errors after a Python or some library update.
There was a problem hiding this comment.
There are 18,209 warning messages and unfortunately pytest prints error messages first => I found it hard to locate the errors. Most of the warnings seem to be around the use of numpy.matrix, which I figure we will get rid of starting in v0.9.0.
control/tests/freqresp_test.py
Outdated
| def suite(): | ||
| return unittest.TestLoader().loadTestsFromTestCase(TestTimeresp) | ||
| return unittest.TestLoader().loadTestsFromTestCase(TestFreqresp) | ||
|
|
||
| if __name__ == '__main__': | ||
| unittest.main() |
There was a problem hiding this comment.
This is code from the unittest framework. Pytest does not use it. IMHO, let's remove suite() and the __main__ sections from all test files.
There was a problem hiding this comment.
I have removed the suite() functions, which were often not properly set up and were only used in tests/run_all.py, which I don't think we were using anyway.
I left in the __main__ sections, so that you could (if you wanted) call a test script directly (rather than having to use pytest).
This PR switches the unit testing to use
pytestfor Travis CI instead of the deprecatedsetup.py test. It also adds an optional test for Python 3.8.