- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目前使用 allure-pytest-adaptor 1.7.8、pytest 3.2.1 和 pytest-xdist 1.20.0
当我使用 xdist 并行运行测试时出现问题,如果我以串行方式运行所有测试,则没有这样的问题:
如果只有 1 次或没有失败,则可以生成诱惑报告
当测试运行中出现多个失败时,无法生成诱惑报告,堆栈跟踪和错误消息:
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/bin/py.test", line 11, in <module>
sys.exit(main())
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/config.py", line 58, in main
return config.hook.pytest_cmdline_main(config=config)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
res = hook_impl.function(*args)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/main.py", line 139, in pytest_cmdline_main
return wrap_session(config, _main)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/main.py", line 133, in wrap_session
exitstatus=session.exitstatus)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 745, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 339, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 334, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 613, in execute
return _wrapped_call(hook_impl.function(*args), self.execute)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 250, in _wrapped_call
wrap_controller.send(call_outcome)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/terminal.py", line 406, in pytest_sessionfinish
outcome.get_result()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
raise ex[1].with_traceback(ex[2])
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 265, in __init__
self.result = func()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/vendored_packages/pluggy.py", line 614, in execute
res = hook_impl.function(*args)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/pytest_plugin.py", line 494, in pytest_sessionfinish
self.impl._write_xml(f, s)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/common.py", line 254, in _write_xml
xmlfied.toxml(),
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 129, in toxml
manys = sum([[(m[0], v) for v in m[1]] for m in entries(Many)], [])
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 123, in entries
for (name, rule) in items
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 124, in <listcomp>
if isinstance(rule, clazz) and rule.check(getattr(self, name))]
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 109, in value
values = super(WrappedMany, self).value(name, what)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 103, in value
return [self.rule.value(name, x) for x in what]
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 103, in <listcomp>
return [self.rule.value(name, x) for x in what]
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 92, in value
return what.toxml()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 128, in toxml
nested = entries(Nested)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 123, in entries
for (name, rule) in items
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 124, in <listcomp>
if isinstance(rule, clazz) and rule.check(getattr(self, name))]
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 92, in value
return what.toxml()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 126, in toxml
elements = entries(Element)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 123, in entries
for (name, rule) in items
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 124, in <listcomp>
if isinstance(rule, clazz) and rule.check(getattr(self, name))]
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/rules.py", line 80, in value
return element_maker(self.name or name, self.namespace)(legalize_xml(unicodify(what)))
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/allure/utils.py", line 126, in unicodify
return text_type(something) # @UndefinedVariable
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/_code/code.py", line 694, in __str__
s = self.__unicode__()
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/_code/code.py", line 704, in __unicode__
self.toterminal(tw)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/_code/code.py", line 735, in toterminal
element[0].toterminal(tw)
File "/data/jenkins/workspace/Pilot_WebUI_Python_Functional_Test/automated-tests/.tox/jenkins-webui/lib/python3.5/site-packages/_pytest/_code/code.py", line 764, in toterminal
if entry.style == "long":
AttributeError: 'dict' object has no attribute 'style'
最佳答案
我使用以下方法遇到了同样的问题:
ReprTraceback
类用于处理故障输出数据。
__dict__
在对象中存储测试报告属性来解决。目的。事实证明,作者已经部分解决了这个问题。我只是更新了诱惑中的现有方法
pytest_plugin.py
公开所有必要的报告数据,然后用更新的方法替换预期的报告终结器条件。我在这里有一个来自插件的 fork 版本的补丁:
关于pytest-xdist 导致 AttributeError : 'dict' object has no attribute 'style' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46919802/
我遇到了这两个错误,“AttributeError:在 DataLoader 工作进程 0 中捕获 AttributeError”,“AttributeError:模块“torchvision.tra
以下是我的代码。在最后一行中,我无法将Items[node.ind].v值设置为我想要的node.v,并收到错误。我不知道出了什么问题,但一定是基于语法,因为使用node.v+=1这样的语句也会显示相
我们准备了以下python脚本来显示word表格中的图片。 import matplotlib.pyplot as plt import pylab import win32com.client as
我需要一种方法来获取 TensorFlow 中任何类型层(即 Dense、Conv2D 等)的输出张量的形状。根据文档,有 output_shape 属性可以解决这个问题。但是,每次我访问它时,我都会
除了我之前的问题,关于如何在 Python 中打开 csv 文件,我仍然没有成功地做到这一点,并且从一个错误到另一个错误。 我的Python代码如下: @app.route("/admin", met
这是我在Google Colab中使用的代码。当我打这些电话的时候。我收到以下错误。这很奇怪。我以前从来没有见过这个问题。有没有人能帮我一下?我是不是做错了什么?
我想将Excel中的数据添加到词典中。但是,当我使用.append(TOTAL_SALES)时出现错误,当然,如果我使用+=TOTAL_SALES,则没有问题,只是我获得的是总和,而不是3个单独月份的
我想将Excel中的数据添加到词典中。但是,当我使用.append(TOTAL_SALES)时出现错误,当然,如果我使用+=TOTAL_SALES,则没有问题,只是我获得的是总和,而不是3个单独月份的
我正在尝试使用 gr_modtool.py 在 gnuradio 中创建一个新的 DSP 模块。 gnuradio 版本是 3.3.0。我在 include 文件夹中的 abc.h 文件中有以下代码
AttributeError:尝试在序列化器 UserKeywordSerializer 上获取字段 user 的值时出现 AttributeError。序列化程序字段可能命名不正确,并且与 Quer
我有以下使用Chatterbot第三方库的代码:。当我尝试使用代码时,从Visual Studio收到如下错误:。我安装了以下程序包:。我尝试了使用Python3.9和3.11以及Chatterbot
我有以下使用Chatterbot第三方库的代码:。当我尝试使用代码时,从Visual Studio收到如下错误:。我安装了以下程序包:。我尝试了使用Python3.9和3.11以及Chatterbot
我有以下使用Chatterbot第三方库的代码:。当我尝试使用代码时,从Visual Studio收到如下错误:。我安装了以下程序包:。我尝试了使用Python3.9和3.11以及Chatterbot
通常,当我尝试使用BeautifulSoup解析网页时,BeautifulSoup函数会得到NONE结果,否则就会引发AttributeError。。以下是一些独立的(即,由于数据是硬编码的,不需要访
通常,当我尝试使用BeautifulSoup解析网页时,BeautifulSoup函数会得到NONE结果,否则就会引发AttributeError。。以下是一些独立的(即,由于数据是硬编码的,不需要访
我试图配置预提交挂接,在运行预提交运行--所有文件时,我收到以下错误:。我已尝试升级pip以解决此问题pip安装--升级pip,但我收到另一个错误:。我尝试检查PIP和PIP3的版本,但现在我也收到了
我收到一个 AttributeError 我似乎无法解决。我正在处理两个类(class)。 第一个类就是这样。 class Partie: def __init__(self):
在 Django (1.4) 中迁移 South (0.7.5) 时,我遇到了这个错误。我最近将时区设置更改为 false,即 USE_TZ = False 以解决另一个问题。有任何想法吗?谢谢 ~/
当我尝试在两个序列化程序之间创建嵌套关系时出现 AttributeError。奇怪的是,我正在做与另一个 API 完全相同的事情,但这次我没有让它工作。这是代码: class UserSerializ
试图获得 manytomany django 中的关系,但我收到以下错误 - Got AttributeError when attempting to get a value for field n
我是一名优秀的程序员,十分优秀!