mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 16:43:05 +02:00
The previous two fix attempts (removing -n 4 xdist parallelism, ruling
out a Python 3.12-vs-3.14 difference) both targeted the wrong cause for
the coverage gap on _alarm_display.py:71. The actual bug:
_restore_display() was never mocked in the _block_extra_devices fixture
shared by test_alarm_part2/3/4.py, so every test exercising
on_close()/_lock.close() ran the REAL _restore_display(), which calls
the REAL shutil.which('xset'). My dev machine has /usr/bin/xset
installed, so it always hit the "found" branch by accident; the CI
runner doesn't, so it always hit the "missing" branch instead, and
there was no dedicated unit test for the "found" path at all.
Fix: mock _restore_display in that fixture (matching its already-mocked
siblings _restore_fans/_restore_alarm_audio/turn_off_plug), and add a
dedicated, hermetic test for the xset-found branch that doesn't depend
on whether the running machine actually has xset on PATH. Side benefit:
the test suite no longer makes a real `xset s on` subprocess call on
the developer's desktop as an untracked side effect of running tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A7vbgtFfZmfxJtN5DdtJky
|
||
|---|---|---|
| .. | ||
| agent-automation-bootstrap.json | ||
| diet-guard-gatelock-migration-2026-06.json | ||
| diet-guard-meal-and-trigger-fix-2026-06-10.json | ||
| digital-wellbeing-bypass-hardening-2026-05.json | ||
| extract-inline-python-2026-06-06.json | ||
| file-length-split-2026-06-14.json | ||
| linux-config-cleanup-2026-05.json | ||
| linux-config-polling-hardening-2026-05-14.json | ||
| linux-config-runtime-hardening-2026-05-08.json | ||
| linux-config-scripts-split-2026-05.json | ||
| morning-routine-unified-2026-05-25.json | ||
| pc-polling-runtime-validation-2026-05-10.json | ||
| phone-curfew-demo-net-stopgap-2026-06-13.json | ||
| phone-focus-mode-fresh-install-2026-05-31.json | ||
| phone-focus-mode-netd-cache-fix-2026-05.json | ||
| phone-night-curfew-2026-06-13.json | ||
| protondb-gold-silver-fix.json | ||
| pylint10-r0801-schema-validation-2026-06.json | ||
| root-cleanup-2026-05-14.json | ||
| run-sh-wrapper-smoke.json | ||
| screen-locker-scheduled-skip-2026-05.json | ||
| screen-locker-sick-tracker-2026-05-14.json | ||
| screen-locker-weekly-check-2026-05-28.json | ||
| stats-hltb-fixes-2026-05-28.json | ||
| steam-backlog-cache-refetch-reduction-2026-05-08.json | ||
| steam-backlog-finished-only-next-pick-2026-05.json | ||
| steam-backlog-module-split-2026-05.json | ||
| steam-backlog-protected-ids-2026-05-14.json | ||
| steam-backlog-whitelist-hardening-2026-05.json | ||
| steam-library-hide-fix-2026-05-17.json | ||
| sync-tests-fix-coverage-2026-05.json | ||
| template.json | ||
| usage-report-hz-cpu-fix-20260604.json | ||
| vendor-agent-skills-import.json | ||
| wake-alarm-gatelock-migration-2026-06-22.json | ||
| wake-alarm-hibernate-2026-05.json | ||
| wake-alarm-loudness-typeable-2026-05.json | ||
| wake-alarm-plug-fans-warnings-2026-05.json | ||
| wake-alarm-refactor-2026-05-30.json | ||
| wake-alarm-restore-display-test-gap-2026-06-22.json | ||