Commit cde89500 authored by juga's avatar juga
Browse files

fix: tests: debug log for tests by default

and fix test that didn't consider that there might be other logs from
other threads.

Closes #33797.
parent a2b25834
Pipeline #3631 failed with stage
in 24 minutes and 18 seconds
...@@ -16,3 +16,6 @@ tag_prefix = v ...@@ -16,3 +16,6 @@ tag_prefix = v
# String at the start of all unpacked tarball filenames. # String at the start of all unpacked tarball filenames.
parentdir_prefix = sbws- parentdir_prefix = sbws-
[tool:pytest]
log_cli=true
log_cli_level=DEBUG
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"""Unit tests for resultdump.""" """Unit tests for resultdump."""
import datetime import datetime
import logging
from sbws.lib.relaylist import Relay from sbws.lib.relaylist import Relay
from sbws.lib.resultdump import ( from sbws.lib.resultdump import (
...@@ -37,8 +38,8 @@ def test_trim_results_ip_changed_on_changed_ipv6(caplog, ...@@ -37,8 +38,8 @@ def test_trim_results_ip_changed_on_changed_ipv6(caplog,
results_dict = trim_results_ip_changed(resultdict_ip_not_changed, results_dict = trim_results_ip_changed(resultdict_ip_not_changed,
on_changed_ipv6=True) on_changed_ipv6=True)
assert resultdict_ip_not_changed == results_dict assert resultdict_ip_not_changed == results_dict
for record in caplog.records: # There might be other logs from other threads.
assert record.levelname == 'WARNING' with caplog.at_level(logging.WARNING):
assert 'Reseting bandwidth results when IPv6 changes, ' \ assert 'Reseting bandwidth results when IPv6 changes, ' \
'is not yet implemented.\n' in caplog.text 'is not yet implemented.\n' in caplog.text
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment