From 44696a9eb412120832ae21ebbefe5d1b0de2c1c6 Mon Sep 17 00:00:00 2001 From: Gabriel Luiz Freitas Almeida Date: Tue, 30 Jan 2024 16:16:38 -0300 Subject: [PATCH] Refactor locustfile.py: Import modules and reorder code --- tests/locust/locustfile.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/locust/locustfile.py b/tests/locust/locustfile.py index 1fc91ee2c..856e3f6dd 100644 --- a/tests/locust/locustfile.py +++ b/tests/locust/locustfile.py @@ -1,11 +1,12 @@ -from locust import FastHttpUser, task, between import random import time -import orjson -from rich import print -import httpx from pathlib import Path +import httpx +import orjson +from locust import FastHttpUser, between, task +from rich import print + class NameTest(FastHttpUser): wait_time = between(1, 5) @@ -13,7 +14,7 @@ class NameTest(FastHttpUser): with open("names.txt", "r") as file: names = [line.strip() for line in file.readlines()] - headers = {} + headers: dict = {} def poll_task(self, task_id, sleep_time=1): while True: