简体   繁体   中英

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

Consider using the pytest.ini option addopts like this:

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM