Stefan-Endres/shgo

Move testing to pytest

alchemyst opened this issue · 4 comments

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

This commit 03ed23a 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 9af4c24 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.

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

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.

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!