From 91fa494f4e780844529e04b424ebf81c2511d1b7 Mon Sep 17 00:00:00 2001 From: Max Ryabinin Date: Sun, 9 Jun 2024 21:32:12 +0100 Subject: [PATCH] Override the logging level in test_cli_scripts (#617) --- tests/test_cli_scripts.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_cli_scripts.py b/tests/test_cli_scripts.py index 3047d4c04..97c674000 100644 --- a/tests/test_cli_scripts.py +++ b/tests/test_cli_scripts.py @@ -1,3 +1,4 @@ +import os import re from subprocess import PIPE, Popen from time import sleep @@ -8,11 +9,16 @@ def test_dht_connection_successful(): dht_refresh_period = 1 + cloned_env = os.environ.copy() + # overriding the loglevel to prevent debug print statements + cloned_env["HIVEMIND_LOGLEVEL"] = "INFO" + dht_proc = Popen( ["hivemind-dht", "--host_maddrs", "/ip4/127.0.0.1/tcp/0", "--refresh_period", str(dht_refresh_period)], stderr=PIPE, text=True, encoding="utf-8", + env=cloned_env, ) first_line = dht_proc.stderr.readline() @@ -28,6 +34,7 @@ def test_dht_connection_successful(): stderr=PIPE, text=True, encoding="utf-8", + env=cloned_env, ) # skip first two lines with connectivity info