gpt4 book ai didi

python-2.7 - py.test "--collectonly doesn' t尊重-k”问题没有解决?

转载 作者:行者123 更新时间:2023-12-04 16:46:04 24 4
gpt4 key购买 nike

我遇到过这个py.test问题报告中描述的问题:
https://bitbucket.org/hpk42/pytest/issue/27/collectonly-doesnt-respect-k

这些是 Jenkins 控制台的结果:
~~~~~~~~~~~~~~~~~~
+ py.test -v -k test_example --junitxml=functionaltests/reports/res.xml
============================ 测试 session 开始 ================== ============
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

~~~~~~~~~~~~~~~~~~

不应收集或执行测试模块“test_smm_healthcheck.py”。修复 - 已解决 - 是否尚未发布?我正在运行 py.test 版本 2.3.4。

最佳答案

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

关于python-2.7 - py.test "--collectonly doesn' t尊重-k”问题没有解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14464762/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com