如何告诉py.test安装所需的模块?

时间:2013-03-28 18:32:18

标签: python pytest

我正在使用py.test来运行测试但它可能无法运行,因为它由于缺少依赖模块而无法收集测试。

我必须提到我的setup.py已经包含这些模块:

setup(
    ...
    tests_require=['soappy'],
    ...

但是,似乎我遗漏了一些东西,会告诉py.test安装这些模块。

1 个答案:

答案 0 :(得分:0)

pytest不处理setup.py本身,test_requires是setuptools通过调用setup.py来关注的东西。文档展示了如何将pytest运行与setup.py集成的两种方法:http://pytest.org/latest/goodpractises.html#integrating-with-distutils-python-setup-py-test