我试图并行运行单个测试方法,但我无法做到。我安装了pytest-xdist,但它只能并行运行多个测试方法,而不是单个方法。
任何人都可以告诉我如何实现这一目标吗?
from page.to_run_login import RegisterLogin
from utilites.testStatus import TestStatus
import unittest
import pytest
import time
@pytest.mark.usefixture("oneTimeSetUp","setUp")
class RegisterTest(unittest.TestCase):
@pytest.fixture(autouse=True)
def classSetup(self,oneTimeSetUp):
self.rg = RegisterLogin(self.driver)
self.ts = TestStatus(self.driver)
@pytest.mark.run(order=1)
def test_registerLink(self):
for i in range(10):
self.rg.register()
self.rg.select_state_name()
self.rg.select_city_name()
self.rg.select_ready_wait()
self.rg.select_ready_pay()
self.rg.select_submit()
self.rg.driver.back()
self.rg.driver.refresh()