Stefan-Endres / shgo

Simplicial Homology Global Optimization
https://stefan-endres.github.io/shgo
MIT License
44 stars 12 forks source link

Move testing to pytest #11

Closed alchemyst closed 6 years ago

alchemyst commented 6 years ago

pytest is superior to UnitTest in almost every way. SciPy is also moving their test suite to pytest in the 1.0.0 release

Stefan-Endres commented 6 years ago

This commit 03ed23a145b6f29279e28c7b66b81e2804653cbe refactors the test suite to run both pytest and unittest which both pass locally, the setup.py and .yml files have also been updated. This commit 9af4c2415fdd104794b9a4a70b21401f7bec2924 removes unittests entirely. We still use numpy.testing for most of our assertions which is also replacable with pytest if needed.

The Travis log failed to run python -m pytest -v, I will read the documentation to see what we need to run py.test.

alchemyst commented 6 years ago

You call pytest just with the command pytest and configure the settings in pytest.ini

alchemyst commented 6 years ago

For coverage to work, you need to use pytest-cov.

PS: Remember you can refer to an issue number in the commit message to automatically close an issue. (So a commit message "Moved to pytest, closes #11") would close this issue as soon as you push it.

Stefan-Endres commented 6 years ago

Travis is passing with e7780ee. I will test another commit to see if coveralls works using pytest-cov, coverage appears to have decreased on https://coveralls.io/github/Stefan-Endres/shgo for some reason.

Thank you for the commit message tip!