How to run all tests in a setup.py script?
I woul开发者_如何学Cd like to write a setup.py script that runs all of my django app's tests and fails the installation if one of the tests don't pass.
How can it be done? What do I need to do?Assuming you're using setuptools, check out test build package and run a unittest suite from their docs. which I believe lets you run setup.py test
and doesn't install your package, but runs the tests in an egg. From here you can run setup.py install
. This does seem to be a new command (my version doesn't have it listed).
精彩评论