3 ms·
I wish more teams considered it important to expose the tests as a module or subpackage that is included in distribution, such as what numpy does with numpy.tes
by mlthoughts2018 8y ago
I wish more teams considered it important to expose the tests as a module or subpackage that is included in distribution, such as what numpy does with numpy.test(‘full’) [0].
When you are knee deep in some long-running docker container with some data analysis going on in an interactive console and get hit by a weird bug, it can be so, so helpful to easily run unit tests post-installation to verify everything is setup correctly.
It can also be a good step in CI if you build minimal docker containers that should house an installation of the package at the given commit, and have e.g. Jenkins build the container with the package installed from that commit and then launch the container with a simple command like
python -c “import mymodule; mymodule.test()”
[0] https://stackoverflow.com/questions/9200727/is-there-a-test-suite-for-numpy-scipy/9200923#9200923 https://stackoverflow.com/questions/9200727/is-there-a-test-...
- closed 8y agoThat's a good point--I used to keep tests outside the package, but it seems like some projects make good use of having people who open issues run the unit tests beforehand.