马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 wsj0794 于 2018-12-29 11:03 编辑
threads = []
t1 = threading.Thread(target=Log.catch_log) # 获取android运行logcat日志的线程
threads.append(t1)
t2 = threading.Thread(target=comm.runUnittest,args=(PsRun,TestItem)) # 执行测试用例的线程
threads.append(t2)
for t in threads:
t.start()
使用了上面的线程后,发现在最后写入excel报告时却报如下错误:
======================================================================
ERROR: tearDownClass (__main__.PsRun)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\xlwings\_xlwindows.py", line 117, in __getattr__
v = getattr(self._inner, item)
File "C:\Program Files\Python36\lib\site-packages\win32com\client\dynamic.py", line 527, in __getattr__
raise AttributeError("%s.%s" % (self._username_, attr))
AttributeError: Open.Path
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "PS_run.py", line 271, in tearDownClass
wb.save(reportSave)
File "C:\Program Files\Python36\lib\site-packages\xlwings\main.py", line 696, in save
return self.impl.save(path)
File "C:\Program Files\Python36\lib\site-packages\xlwings\_xlwindows.py", line 475, in save
saved_path = self.xl.Path
File "C:\Program Files\Python36\lib\site-packages\xlwings\_xlwindows.py", line 137, in __getattr__
self._oleobj_.GetIDsOfNames(0, item)
pywintypes.com_error: (-2147221008, '尚未调用 CoInitialize。', None, None)
----------------------------------------------------------------------
按照网上搜索到的解决方法增加下面两行仍无济于事,请大神们帮忙,万分感谢!!!
import pythoncom
pythoncom.CoInitialize()
注:python版本为:python3.6.6(64bit)
excel模块为:xlwings,Version: 0.15.1
|