mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-14 09:11:00 +01:00
create_locker (+ _relaxed_day / _early_bird variants) patched Path.resolve to return tmp_path, but ScreenLocker.__init__ computes script_dir = Path(__file__).resolve().parent — the .parent turned the intended per-test tmp_path into tmp_path.parent, pytest's session-shared temp base. Every factory-built locker therefore shared ONE workout_log.json, so any test that wrote a log polluted it and test_saves_pending_marker's `assert not locker.log_file.exists()` passed or failed purely by random ordering (pytest-randomly). The flake was invisible until now because CI died at conftest import (missing crdt_sync) before any test ran; fixing that import in the prior commit exposed it. Reproduced deterministically at CI seed 2701400184. Fix: resolve() now returns tmp_path / "screen_locker" so .parent is the unique per-test tmp_path — each locker gets its own log_file. Also stops tests writing workout_log.json into the real source tree. Verified 747 passed across seeds 2701400184/1/42/999/123456 (was 1 failed at the CI seed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PMRRVVkeRyrSaaqueMZKG |
||
|---|---|---|
| .. | ||
| tests | ||
| __init__.py | ||
| _auto_upgrade.py | ||
| _compliance_state.py | ||
| _constants.py | ||
| _early_bird.py | ||
| _extra_benefits.py | ||
| _heat_skip.py | ||
| _log_mixin.py | ||
| _manual_workout_dialog.py | ||
| _manual_workout.py | ||
| _mcp.py | ||
| _phone_verification.py | ||
| _runnerup_db.py | ||
| _runnerup_verification.py | ||
| _shutdown_base.py | ||
| _shutdown.py | ||
| _sick_dialog.py | ||
| _sick_tracker.py | ||
| _status_data.py | ||
| _status.py | ||
| _temperature_status_mixin.py | ||
| _temperature.py | ||
| _time_check.py | ||
| _ui_flows_relaxed.py | ||
| _ui_flows.py | ||
| _ui_widgets.py | ||
| _wake_state.py | ||
| _weekly_check.py | ||
| _window_setup.py | ||
| _workout_credit.py | ||
| _workout_sync.py | ||
| adjust_shutdown_schedule.sh | ||
| screen_lock.py | ||
| status_view.py | ||