【发布时间】:2021-06-12 19:24:56
【问题描述】:
我的代码是这样的
class MyApiTask(TaskSet):
def __init__(self):
super().__init__(self)
@task(1)
def get_response(self):
response = self.client.get("/")
print(response.json())
assert_that(200).is_equal_to(response.status_code)
class MyApiUser(HttpLocust):
task_set = MyApiTask
wait_time = between(1,2)
当我运行它时,我得到:
AttributeError:类型对象“MyApiTask”在尝试运行 locust 时没有属性“task_set”
请帮忙!
【问题讨论】: