On Wed, Apr 18, 2018 at 11:19:33PM +0800, Felix Yan via arch-dev-public wrote:
For testing with not installed python modules, invoking setup.py commands are often preferable and addresses both PYTHONPATH and 2to3.
For nosetests: Use "python setup.py nosetests" instead.
For pytest: Use "python setup.py pytest" instead. Note that "python-pytest-runner" needs to be in checkdepends.
There are additional common hacks if the tests need to invoke an entry points or requires the versioned distribution object. Either:
1) Installing it in a temporary place and hack PYTHONPATH/PATH. 2) Create a sitecustomize.py and add the build dir to site. (See python2-faulthandler for an example)
And finally if above still didn't solve it, you may choose to skip the problematic part of the tests or use "heavier" workarounds like a venv.
I think we should be better at documenting these things. This is super usefull to know about and not something that is obvious to everyone. I'll work on the package guideline pages for Python and Golang whenever I have some spare energy left and will be sure to include this. -- Morten Linderud PGP: 9C02FF419FECBE16