For a package I've authored, I've done python setup.py sdist bdist_wheel
, which generates some package artifacts in the dist/
directory. Now I'd like to run the package's unit tests in those artifacts. What's a good way to do it?
To be clear: an alternative would be to run the tests directly from the local source files, but I want to avoid that to make sure I'm testing the exact pre-built artifact users would be installing (as suggested here).
I'm using Python 3, and I'm on a Linux or Mac OS environment. My context is a build server that builds, tests, and then publishes artifacts (to a private PyPI-like repo) as commits are made to a Git repository.
If there's some other approach I should be using instead, I'm all ears.
What you can do is:
As pointed in the pytest docs take a look to tox as well for your CI server: http://pytest.org/dev/goodpractises.html#use-tox-and-continuous-integration-servers
This is a related question regarding how to test using the installed package: Force py.test to use installed version of module
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With