Python 2.7 py.test“--collectonly不';t尊重-k“;问题没有解决?

Python 2.7 py.test“--collectonly不';t尊重-k“;问题没有解决?,python-2.7,pytest,Python 2.7,Pytest,我遇到了此py.test问题报告中描述的问题: 以下是Jenkins控制台的结果: ~~~~~~~~~~~~~~~~~~ +py.test-v-k test_示例--junitxml=functionaltests/reports/res.xml ===========================================测试会话开始============================== 平台linux2——Python 2.7.3——pytest-2.3.4——/var/li

我遇到了此py.test问题报告中描述的问题:

以下是Jenkins控制台的结果: ~~~~~~~~~~~~~~~~~~ +py.test-v-k test_示例--junitxml=functionaltests/reports/res.xml ===========================================测试会话开始============================== 平台linux2——Python 2.7.3——pytest-2.3.4——/var/lib/jenkins/shiningpanda/jobs/9df20569/virtualenvs/701cc1aa/bin/python2.7 插件:xdist 收集。。。收集了3项/1个错误

functionaltests/test_example.py:40: test_data[apple] PASSED
functionaltests/test_example.py:40: test_data[pear] PASSED
functionaltests/test_example.py:40: test_data[berry] PASSED

==================================== ERRORS ====================================
___________ ERROR collecting functionaltests/test_smm_healthcheck.py ___________
functionaltests/test_smm_healthcheck.py:2: in <module>
>   import models.SMMMicrosites as site_data
E   ImportError: No module named models.SMMMicrosites
 generated xml file: /var/lib/jenkins/workspace/WT/functionaltests/reports/res.xml 
====================== 3 passed, 1 error in 0.05 seconds =======================
Build step 'Virtualenv Builder' marked build as failure
Recording test results
Finished: FAILURE
functionaltests/test\u example.py:40:test\u数据[apple]通过
functionaltests/test_example.py:40:test_数据[pear]通过
功能测试/测试示例。py:40:测试数据[berry]通过
===================================================错误====================================
___________收集功能测试/测试\u smm\u healthcheck.py时出错___________
功能测试/测试\u smm\u健康检查.py:2:in
>将models.smmmicrosite导入为站点数据
E ImportError:没有名为models.smmmicrosite的模块
生成的xml文件:/var/lib/jenkins/workspace/WT/functionaltests/reports/res.xml
=====================================3次通过,0.05秒内出现1次错误=======================
生成步骤“Virtualenv Builder”将生成标记为失败
记录测试结果
完成:失败
~~~~~~~~~~~~~~~~~~

不应收集或执行测试模块“test\u smm\u healthcheck.py”。修复程序(此问题已解决)是否尚未发布?我正在运行py.test版本2.3.4。

“-k”标志不影响收集的内容-仅影响使用--collectonly报告的内容。所以你不能用它来阻止收集。可以使用--ignore=path(一次或多次)来防止收集