Update tests/test_utils_logcfg.py
Run CI Tests / test (push) Successful in 39s

This commit is contained in:
2025-07-28 14:23:37 +02:00
parent 695e1f366e
commit 554113c552
+4 -9
View File
@@ -47,18 +47,13 @@ def test_import_logging_multiple_modules(capfd):
logcfg("TRACE")
setup_import_logging()
import json
import math
import io
import random
import json # duplicate
import math # duplicate
import random # duplicate
modules_to_test = ["json", "math", "io", "random"]
for name in modules_to_test:
importlib.reload(__import__(name))
out, err = capfd.readouterr()
expected_imports = {"json", "math", "io", "random"}
for mod in expected_imports:
for mod in modules_to_test:
assert f"importing: {mod}" in err, f"Missing import log for {mod}"
assert err.count("importing: json") == 1