我使用说明,描述 here
为了测试,我使用这个命令:
py.test --ignore=env
但如果我使用
python setup.py test
pytest 运行所有测试(环境中的+)。
如何在 中跳过测试环境 目录?
谢谢!
更新
设置.py:
from setuptools import setup, find_packages
setup(
packages=find_packages(),
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)
最佳答案
考虑使用 pytest.ini option addopts
像这样:
# This is pytest.ini in your root directory
[pytest]
addopts = --ignore=env
关于python - pytest 与 setup.py 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36391135/