思寒大佬,麻烦帮我看下传值问题,i 值传不回去,导致不能整体运行。

#coding:utf8
import unittest
from framework.pagecommon import BaseElement
from pageobject.page_login import LoginBase
import multiprocessing
from serverstart.create_doc import CreateDoc
from serverstart.read_yaml import ReadUserCommand

class PearMain(unittest.TestCase):
def init(self,methodName=‘runTest’,parame=None):
super(PearMain,self).init(methodName)
global parames
parames = parame
# global server
# server = ServerStart()
class LoginPage(PearMain):

@classmethod
def setUpClass(cls):
    """
    打开server
    :return:
    """
    # cls.pagecommand = BaseElement(parames)
    print('eqweqeqwe', parames)
    print('asdadad',get_count())
    cls.driver = BaseElement(parames)


    # cls.server = ServerStart()
@classmethod
def tearDownClass(cls):
    """
    结束操作
    :return:
    """

def test_login(self):
    """
    logincase
    :return:
    """
    loginpage = LoginBase(i)
    loginpage.login_me(7)
    loginpage.wait(5)
    loginpage.click_login()
    loginpage.wait(5)
    loginpage.username_input(18296117598)
    loginpage.wait(5)
    loginpage.passworld_input(111111)
    loginpage.wait(5)
    loginpage.click_logging()
    loginpage.wait(3)
    loginpage.open_check()
    loginpage.wait(3)
    loginpage.open_check()
    loginpage.get_windows_img()

def appium_init():
server = CreateDoc()
server.main()

def get_suite(i):
suite = unittest.TestSuite()
suite.addTest(LoginPage(“test_login”,parame=i))
def get_count():
write_user_file =ReadUserCommand()
count = write_user_file.get_find_lines()
return count

if name == ‘main’:
appium_init()
threads = []
get = LoginPage()
for i in range(get_count()):
print(i)
t = multiprocessing.Process(target=get_suite,args=(str(i),))
threads.append(t)
for j in threads:
j.start()

关闭