Skip to content

Commit

Permalink
Override the logging level in test_cli_scripts (#617)
Browse files Browse the repository at this point in the history
  • Loading branch information
mryab authored Jun 9, 2024
1 parent 96f9ba3 commit 91fa494
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_cli_scripts.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import re
from subprocess import PIPE, Popen
from time import sleep
Expand All @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 91fa494

Please sign in to comment.