[arch-dev-public] Unit tests for python packages
baptiste at bitsofnetworks.org
Wed Apr 18 09:53:01 UTC 2018
Does anyone have experience with unit tests for python packages? It's
really useful to spot missing runtime dependencies, but it's a pain to get
Here is what I saw:
1) just running "python -m unittest discover" or "nosetests" or equivalent
in the check() function does not work, because the package is not yet
installed (so all imports will fail)
2) setuptools is supposed to have a unittest integration such that
"python setup.py test" should work out of the box, but in my case it
never finds any tests to run
3) I've seen some more... "creative" solutions :)
So far, the only working solution I found is playing with PYTHONPATH:
python -m unittest discover
But it's a hack, and it probably won't work with things like 2to3.
Any better ideas?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the arch-dev-public