test(core): enable logging from tests and fixtures
What changed, and why it matters
This commit only changes test infrastructure. It enables extra logging output during automated testing so developers can see more detail when running tests. There is no change to the actual Trezor firmware or wallet security code, and no security risk is apparent.
No action needed. This is a benign test-only logging change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/conftest.py to add a logging.StreamHandler and attach it to the test logger when pytest verbose mode is enabled. It also applies a PrettyProtobufFormatter. This is purely a test/debugging aid and does not alter production firmware, device behavior, or any security-sensitive logic.
Changed components
tests/conftest.pyInspect captured patch +7 / −0
diff --git a/tests/conftest.py b/tests/conftest.py
index cac3901d..482fce19 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -573,12 +573,19 @@ def pytest_configure(config: "Config") -> None:
verbosity = config.getoption("verbose")
if verbosity:
log.enable_debug_output(verbosity)
+ handler = logging.StreamHandler()
verbose_log_file = config.getoption("verbose_log_file")
if verbose_log_file:
handler = logging.FileHandler(verbose_log_file)
log.enable_debug_output(verbosity, handler)
+ # enable logging for test cases and fixtures
+ logger = logging.getLogger(__name__.rsplit(".", 1)[0])
+ handler.setFormatter(log.PrettyProtobufFormatter())
+ logger.setLevel(logging.DEBUG)
+ logger.addHandler(handler)
+
idval_orig = IdMaker._idval_from_value
def idval_from_value(self: IdMaker, val: object) -> str | None:
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.