Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pytest with setup.py test

Tags:

python

pytest

I use instructions, that described here

For test I use this command:

py.test --ignore=env

But if I use

python setup.py test

pytest runs all test (+ in env).

How to skip test in env dir?

Thanks!

UPDATE

setup.py:

from setuptools import setup, find_packages

setup(
    packages=find_packages(),
    setup_requires=['pytest-runner'],
    tests_require=['pytest'],
)
like image 867
Lev Avatar asked Apr 03 '16 21:04

Lev


1 Answers

setup.py test is deprecated as described in the pytest-runner repo: https://github.com/pytest-dev/pytest-runner#deprecation-notice.

The recommended approach is to call python -m pytest directly, as in your first command.

like image 103
Nzbuu Avatar answered Oct 16 '22 10:10

Nzbuu