diff --git a/lib/lis2mdl/lis2mdl/device.py b/lib/lis2mdl/lis2mdl/device.py index e90ea880..a34f664e 100644 --- a/lib/lis2mdl/lis2mdl/device.py +++ b/lib/lis2mdl/lis2mdl/device.py @@ -54,10 +54,7 @@ def __init__( # Perform a soft reset to ensure the sensor starts in a known state. self._write_reg(LIS2MDL_CFG_REG_A, 0x20) # SOFT_RST=1 (not 0x10) - try: - sleep_ms(10) # Small delay for reset to complete - except Exception: - pass + sleep_ms(10) # Small delay for reset to complete # Configure the sensor's operating mode, output data rate, and other settings. odr_bits = {10: 0b00, 20: 0b01, 50: 0b10, 100: 0b11}.get(odr_hz, 0b00) diff --git a/pyproject.toml b/pyproject.toml index e94eb029..c90ad4f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ select = [ "PYI", # flake8-pyi "RSE", # flake8-raise "RUF", # Ruff-specific rules + "S110", # flake8-bandit: try-except-pass (no silent exception suppression) "SIM", # flake8-simplify "T10", # flake8-debugger "PERF", # Perflint diff --git a/tests/report_plugin.py b/tests/report_plugin.py index 289b7a15..68206f9b 100644 --- a/tests/report_plugin.py +++ b/tests/report_plugin.py @@ -40,7 +40,8 @@ def _get_board_info(port): "platform": lines[4], } except Exception: - pass + # Best-effort: report metadata is optional, never fail the test session. + return {} return {}