pytest with setup.py test

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 11:52:11

问题


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

回答1:


Consider using the pytest.ini option addopts like this:

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


来源:https://stackoverflow.com/questions/36391135/pytest-with-setup-py-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!