Leon
Leon

Reputation: 6554

pytest with setup.py test

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'],
)

Upvotes: 14

Views: 16425

Answers (2)

Nzbuu
Nzbuu

Reputation: 5251

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.

Upvotes: 4

Artemis
Artemis

Reputation: 321

Consider using the pytest.ini option addopts like this:

# This is pytest.ini in your root directory
[pytest]
addopts = --ignore=env

Upvotes: 8

Related Questions