From a2a041f66145bfbfe97cba55982c96546d5c5367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thierry=20Yg=C3=A9?= Date: Sat, 26 Oct 2024 14:22:58 +0200 Subject: [PATCH] fix: Mypy reported issues --- locust/stats.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/locust/stats.py b/locust/stats.py index 24a5a55e7e..7e63addb37 100644 --- a/locust/stats.py +++ b/locust/stats.py @@ -198,7 +198,7 @@ def __init__(self, use_response_times_cache=True, environment: Environment | Non self.errors: dict[str, StatsError] = {} self.total = StatsEntry(self, "Aggregated", None, use_response_times_cache=self.use_response_times_cache) self.environment = environment - self.history = [] + self.history: list[dict] = [] @property def num_requests(self): @@ -284,7 +284,9 @@ class StatsEntry: Represents a single stats entry (name and method) """ - def __init__(self, stats: RequestStats | None, name: str, method: str, use_response_times_cache: bool = False): + def __init__( + self, stats: RequestStats | None, name: str, method: str | None, use_response_times_cache: bool = False + ): self.stats = stats self.name = name """ Name (URL) of this stats entry """