What changed, and why it matters
This commit is a minor cleanup and test-fix change. It replaces a debug logging line with a commented-out print statement and adds mock modules so the test suite can run without Raspberry Pi-specific hardware dependencies. There is no security-relevant change.
No security action needed. Treat as routine maintenance/test hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff in controller.py comments out a timing debug print in the BackgroundImportThread and removes some blank lines. The diff in tests/base.py adds MagicMock entries for ‘numpy’ and ‘seedsigner.hardware.pivideostream’ so tests can import the controller without failing due to missing Raspberry Pi-only dependencies. No functional behavior of the application is altered, and no vulnerability is introduced or fixed.
Changed components
src/seedsigner/controller.pytests/base.pyInspect captured patch +3 / −4
diff --git a/src/seedsigner/controller.py b/src/seedsigner/controller.py
index 0107081..776abb9 100644
--- a/src/seedsigner/controller.py
+++ b/src/seedsigner/controller.py
@@ -60,7 +60,7 @@ class BackgroundImportThread(BaseThread):
def time_import(module_name):
last = time.time()
import_module(module_name)
- logger.debug(f"{time.time() - last:0.4f}: {module_name}")
+ # print(f"{time.time() - last:0.4f}: {module_name}")
time_import('embit')
time_import('seedsigner.helpers.embit_utils')
@@ -75,11 +75,8 @@ class BackgroundImportThread(BaseThread):
# Get MainMenuView ready to respond quickly
time_import('seedsigner.views.scan_views')
-
time_import('seedsigner.views.seed_views')
-
time_import('seedsigner.views.tools_views')
-
time_import('seedsigner.views.settings_views')
diff --git a/tests/base.py b/tests/base.py
index e370296..77a20bc 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -5,12 +5,14 @@ from typing import Callable
# Prevent importing modules w/Raspi hardware dependencies.
# These must precede any SeedSigner imports.
+sys.modules['numpy'] = MagicMock() # numpy is only in the Raspi requirements; not needed for tests. But is imported in BackgroundImportThread.
sys.modules['seedsigner.gui.renderer'] = MagicMock()
sys.modules['seedsigner.gui.screens.screensaver'] = MagicMock()
sys.modules['seedsigner.gui.toast'] = MagicMock()
sys.modules['seedsigner.views.screensaver'] = MagicMock()
sys.modules['seedsigner.hardware.buttons'] = MagicMock()
sys.modules['seedsigner.hardware.camera.Camera'] = MagicMock()
+sys.modules['seedsigner.hardware.pivideostream'] = MagicMock()
sys.modules['seedsigner.hardware.st7789_mpy'] = MagicMock()
sys.modules['seedsigner.hardware.ili9341'] = MagicMock()
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.