From 5a6def7ba2da97765a8e8caeb1a2f8c51ea9dad0 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Sun, 5 Jan 2025 20:43:01 +0100 Subject: [PATCH] tests: Correct way to remove accidental env vars --- locust/test/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/locust/test/__init__.py b/locust/test/__init__.py index a7b032c868..b8fc66aef5 100644 --- a/locust/test/__init__.py +++ b/locust/test/__init__.py @@ -17,6 +17,6 @@ import os # Clean environment from stuff you might have lying around -del os.environ["LOCUST_WEB_LOGIN"] +os.environ.pop("LOCUST_WEB_LOGIN", None) # Ensure locust-cloud is not loaded during tests -del os.environ["PGHOST"] +os.environ.pop("PGHOST", None)