locust无头模式下生成的html无法显示图片

img


import math
from locust import LoadTestShape
from locust import HttpUser,TaskSet,task,constant

class UserTasks(TaskSet):

@task
def get_root(self):
    self.client.get('/')

class WebsiteUser(HttpUser):
wait_time = constant(0.5)
tasks = [UserTasks]

class StepLoadShaper(LoadTestShape):
'''
逐步加载实例

参数解析:
    step_time -- 逐步加载时间
    step_load -- 用户每一步增加的量
    spawn_rate -- 用户在每一步的停止/启动
    time_limit -- 时间限制

'''
setp_time = 30
setp_load = 10
spawn_rate = 10
time_limit =  60

def tick(self):
    run_time = self.get_run_time()

    if run_time > self.time_limit:
        return None

    current_step = math.floor(run_time /self.setp_time) +1

    return(current_step * self.setp_load,self.spawn_rate)

locust -f test06.py --host=
百度一下,你就知道 全球领先的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。 http://baidu.com/
--html=test.html --headless


应该不会,你看看是哪里出错了