我使用描述这里的指令
对于测试,我使用以下命令:
py.test --ignore=env但如果我用
python setup.py testpytest运行所有测试(+ in )。
如何在env dir中跳过测试?
谢谢!
更新
setup.py:
from setuptools import setup, find_packages
setup(
packages=find_packages(),
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)发布于 2016-05-11 22:18:12
考虑像这样使用addopts:
# This is pytest.ini in your root directory
[pytest]
addopts = --ignore=env发布于 2021-10-11 12:10:50
不推荐使用setup.py test,如pytest-runner repo:https://github.com/pytest-dev/pytest-runner#deprecation-notice中所描述的。
建议的方法是直接调用python -m pytest,就像在第一个命令中那样。
https://stackoverflow.com/questions/36391135
复制相似问题