From bbf8b013ec21e0a6052cf598b4afc8e39baaca0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85dela?= Date: Thu, 7 Nov 2024 21:17:46 +0100 Subject: [PATCH] fix: check if override_user_weights is empty or None --- locust/env.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/locust/env.py b/locust/env.py index 9fd75271b0..59c7467506 100644 --- a/locust/env.py +++ b/locust/env.py @@ -106,8 +106,9 @@ def __init__( self.worker_logs: dict[str, list[str]] = {} """Captured logs from all connected workers""" - for user_dict in override_user_weights: - self.update_user_class(user_dict) + if override_user_weights: + for user_dict in override_user_weights: + self.update_user_class(user_dict) self._remove_user_classes_with_weight_zero() self._validate_user_class_name_uniqueness()