chore(core): fix a small typo in `thp_common.py`
What changed, and why it matters
This commit is a minor cleanup in Trezor's test code. It fixes a spelling mistake in a helper function name and changes how debug logging is silenced during automated tests. It does not affect the actual device firmware or any user-facing security behavior.
No security action required. Treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch renames thp_common.suppres_debug_log() to thp_common.suppress_debug_log() across ten test files and updates the implementation to set log._min_level = 1 instead of replacing log.debug with a no-op lambda. All changes are confined to the core/tests/ directory and only influence test logging verbosity. No runtime firmware code is modified.
Changed components
core/tests/thp_common.pycore/tests/test_apps.bitcoin.approver.pycore/tests/test_apps.bitcoin.authorization.pycore/tests/test_apps.bitcoin.keychain.pycore/tests/test_apps.common.keychain.pycore/tests/test_apps.ethereum.keychain.pycore/tests/test_storage.cache.pycore/tests/test_trezor.wire.thp.crypto.pycore/tests/test_trezor.wire.thp.pycore/tests/test_trezor.wire.thp.writer.pyInspect captured patch +12 / −12
diff --git a/core/tests/test_apps.bitcoin.approver.py b/core/tests/test_apps.bitcoin.approver.py
index 408f96d7..71e24879 100644
--- a/core/tests/test_apps.bitcoin.approver.py
+++ b/core/tests/test_apps.bitcoin.approver.py
@@ -33,7 +33,7 @@ class TestApprover(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
thp_common.prepare_context()
else:
diff --git a/core/tests/test_apps.bitcoin.authorization.py b/core/tests/test_apps.bitcoin.authorization.py
index aedcadba..70ce988d 100644
--- a/core/tests/test_apps.bitcoin.authorization.py
+++ b/core/tests/test_apps.bitcoin.authorization.py
@@ -26,7 +26,7 @@ class TestAuthorization(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
thp_common.prepare_context()
else:
diff --git a/core/tests/test_apps.bitcoin.keychain.py b/core/tests/test_apps.bitcoin.keychain.py
index 25239dad..9a32762f 100644
--- a/core/tests/test_apps.bitcoin.keychain.py
+++ b/core/tests/test_apps.bitcoin.keychain.py
@@ -21,7 +21,7 @@ class TestBitcoinKeychain(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
thp_common.prepare_context()
def setUp(self):
@@ -120,7 +120,7 @@ class TestAltcoinKeychains(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
thp_common.prepare_context()
def setUp(self):
diff --git a/core/tests/test_apps.common.keychain.py b/core/tests/test_apps.common.keychain.py
index 8d0839f3..bd93244c 100644
--- a/core/tests/test_apps.common.keychain.py
+++ b/core/tests/test_apps.common.keychain.py
@@ -25,7 +25,7 @@ class TestKeychain(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
thp_common.prepare_context()
else:
diff --git a/core/tests/test_apps.ethereum.keychain.py b/core/tests/test_apps.ethereum.keychain.py
index 6d55e381..09564027 100644
--- a/core/tests/test_apps.ethereum.keychain.py
+++ b/core/tests/test_apps.ethereum.keychain.py
@@ -84,7 +84,7 @@ class TestEthereumKeychain(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
thp_common.prepare_context()
def setUp(self):
diff --git a/core/tests/test_storage.cache.py b/core/tests/test_storage.cache.py
index ee7d8e1b..16fe8102 100644
--- a/core/tests/test_storage.cache.py
+++ b/core/tests/test_storage.cache.py
@@ -39,7 +39,7 @@ class TestStorageCache(unittest.TestCase):
def setUpClass(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
super().__init__()
def setUp(self):
diff --git a/core/tests/test_trezor.wire.thp.crypto.py b/core/tests/test_trezor.wire.thp.crypto.py
index bbb4b3ba..da05553f 100644
--- a/core/tests/test_trezor.wire.thp.crypto.py
+++ b/core/tests/test_trezor.wire.thp.crypto.py
@@ -79,7 +79,7 @@ class TestTrezorHostProtocolCrypto(unittest.TestCase):
def __init__(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
super().__init__()
def test_encryption(self):
diff --git a/core/tests/test_trezor.wire.thp.py b/core/tests/test_trezor.wire.thp.py
index cd0af8d7..ec5da789 100644
--- a/core/tests/test_trezor.wire.thp.py
+++ b/core/tests/test_trezor.wire.thp.py
@@ -13,7 +13,7 @@ class TestTrezorHostProtocol(unittest.TestCase):
def __init__(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
interface_manager.encode_iface = thp_common.dummy_encode_iface
super().__init__()
diff --git a/core/tests/test_trezor.wire.thp.writer.py b/core/tests/test_trezor.wire.thp.writer.py
index b3f33160..14abba31 100644
--- a/core/tests/test_trezor.wire.thp.writer.py
+++ b/core/tests/test_trezor.wire.thp.writer.py
@@ -71,7 +71,7 @@ class TestTrezorHostProtocolWriter(unittest.TestCase):
def __init__(self):
if __debug__:
- thp_common.suppres_debug_log()
+ thp_common.suppress_debug_log()
super().__init__()
def setUp(self):
diff --git a/core/tests/thp_common.py b/core/tests/thp_common.py
index b9a72bf3..3fba09e2 100644
--- a/core/tests/thp_common.py
+++ b/core/tests/thp_common.py
@@ -44,7 +44,7 @@ if utils.USE_THP:
if __debug__:
# Disable log.debug
- def suppres_debug_log() -> None:
+ def suppress_debug_log() -> None:
from trezor import log
- log.debug = lambda *args, **kwargs: None
+ log._min_level = 1
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.