示例#1
0
class WebPageTasks(TaskSet):
    def on_start(self):
        config = {}
        self.test_runner = Runner(config, self.client)

    @task
    def test_any(self):
        test_dict = random.choice(self.locust.tests)
        try:
            self.test_runner.run_test(test_dict)
        except (AssertionError, MyBaseError, MyBaseFailure) as ex:
            request_failure.fire(
                request_type=self.test_runner.exception_request_type,
                name=self.test_runner.exception_name,
                response_time=0,
                exception=ex)
示例#2
0
 def on_start(self):
     self.test_runner = Runner(self.client)
     self.testcases = loader.load_locust_tests(self.locust.file_path)
示例#3
0
 def on_start(self):
     config = {}
     self.test_runner = Runner(config, self.client)
示例#4
0
 def on_start(self):
     self.test_runner = Runner(self.locust.config, self.locust.functions,
                               self.client)