Re: [arch-dev-public] Unit tests for python packages

2018-04-18 Thread Morten Linderud via arch-dev-public
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

Re: [arch-dev-public] Unit tests for python packages

2018-04-18 Thread Felix Yan via arch-dev-public
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 checkdep

Re: [arch-dev-public] Unit tests for python packages

2018-04-18 Thread Baptiste Jonglez
On 18-04-18, Levente Polyak wrote: > On April 18, 2018 11:53:01 AM GMT+02:00, Baptiste Jonglez > wrote: > >So far, the only working solution I found is playing with PYTHONPATH: > > > >cd "$srcdir/$pkgname-$pkgver/tests" > >export PYTHONPATH="$srcdir/$pkgname-$pkgver/src" > >python -m

Re: [arch-dev-public] Unit tests for python packages

2018-04-18 Thread Levente Polyak via arch-dev-public
On April 18, 2018 11:53:01 AM GMT+02:00, Baptiste Jonglez wrote: >Hi, > >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 >to work. > >Here is what I saw: > >1) just running "python -m unittest disc

[arch-dev-public] Unit tests for python packages

2018-04-18 Thread Baptiste Jonglez
Hi, 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 to work. Here is what I saw: 1) just running "python -m unittest discover" or "nosetests" or equivalent in the check() function does not work,