'CollectReport' object has no attribute 'description'

错误栈信息:

INTERNALERROR> File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\callers.py", line 80, in get_result
ll
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "f:\testproject\graspAutoTest\conftest.py", line 34, in pytest_html_results_table_row
INTERNALERROR> cells.insert(1, html.td(report.description))
INTERNALERROR> AttributeError: CollectReport object has no attribute description

INTERNALERROR> AttributeError: ‘CollectReport‘ object has no attribute ‘description‘

INTERNALERROR>     reports.append(call_and_report(item, "call", log))
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\_pytest\runner.py", line 217, in call_and_report
INTERNALERROR>     report: TestReport = hook.pytest_runtest_makereport(item=item, call=call)
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\hooks.py", line 286, in __call__  
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\manager.py", line 93, in _hookexecINTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\manager.py", line 84, in <lambda> 
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "C:\Users\rwxwin10\AppData\Local\Programs\Python\Python38\lib\site-packages\pluggy\callers.py", line 203, in _multicall
INTERNALERROR>     gen.send(outcome)
INTERNALERROR>   File "f:\testproject\graspAutoTest\conftest.py", line 58, in pytest_runtest_makereport
INTERNALERROR>     capture_screenshots(case_name)
INTERNALERROR>   File "f:\testproject\graspAutoTest\conftest.py", line 76, in capture_screenshots
INTERNALERROR>     raise NameError(没有初始化测试报告目录)
INTERNALERROR> NameError: 没有初始化测试报告目录

NameError: 没有初始化测试报告目录

错误原因:

网上资料说是:根据错误提示,是conftest.py 里面的 函数 pytest_runtest_makereport出错了,是report不存在description属性。
有网友说是缺乏勾函数

'CollectReport' object has no attribute 'description'

 

 

 找了几个小时根源是源代码的page页的page类有错误参数或者测试用例的源码有错误代码:

'CollectReport' object has no attribute 'description'

 

 建议:

调试重新在新项目建立函数直接运行,能直接抛出最本质的错误原因

'CollectReport' object has no attribute 'description'

 

'CollectReport' object has no attribute 'description'

上一篇:Longhorn,企业级云原生容器分布式存储 - 定制默认设置


下一篇:如何利用深度学习技术训练聊天机器人语言模型?