selenium+python 多进程一直报错 5C

#coding=utf-8
import unittest, time, os, multiprocessing
from email.mime.text import MIMEText
import HTMLTestRunner
def EEEcreatsuite1():
casedir=[]
listaa=os.listdir('D:\eclipes_case\test_case\src\')
print listaa
for xx in listaa:
if "test_case" in xx:
casedir.append(xx)
print casedir

suite=[]
for n in casedir:
    testunit=unittest.TestSuite()
    discover=unittest.defaultTestLoader.discover(n,pattern ='start_*.py',top_level_dir=n)
    print discover
    for test_suite in discover:
        for test_case in test_suite:
            testunit.addTests(test_case)
    suite.append(testunit)
return suite,casedir

def EEEEEmultiRunCase(suite,casedir):
now = time.strftime('%Y-%m-%d-%H_%M_%S',time.localtime(time.time()))
filename = 'D:\eclipes_case\test_case\src\test_report\'+now+'result.html'
fp = file(filename, 'wb')

proclist=[]
s=0

for i in suite:
    runner = HTMLTestRunner.HTMLTestRunner(
        stream=fp,
        title=u'测试报告',
        description=u'用例执行情况:'
        )

    proc = multiprocessing.Process(target=runner.run(i),args=(i,))
    proclist.append(proc)

    s=s+1
for proc in proclist: proc.start()
for proc in proclist: proc.join()

fp.close()

if name == "__main__":
runtmp = EEEcreatsuite1()
EEEEEmultiRunCase(runtmp[0],runtmp[1])

    报错:

Method=test_youdao_search>]>]>]>
.
Time Elapsed: 0:00:34.414000
.
Time Elapsed: 0:00:13.649000
Process Process-1:
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
TypeError: '_TestResult' object is not callable
Process Process-2:
Traceback (most recent call last):
File "C:\Python27\lib\multiprocessing\process.py", line 258, in _bootstrap
self.run()
File "C:\Python27\lib\multiprocessing\process.py", line 114, in run
self._target(*self._args, **self._kwargs)
TypeError: '_TestResult' object is not callable

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐