[loop-cycle-5] fix: get_token() priority order — config before repo-root fallback #899

Merged
Timmy merged 1 commits from fix/test-failures-on-main into main 2026-03-22 01:52:41 +00:00
Owner

What

Fixes 2 test failures on main in test_health_snapshot.py.

Root cause

get_token() checked .timmy_gitea_token in repo root BEFORE the config-provided token_file. On any dev machine with the real token file present, tests that pass a dummy config path got the real token instead.

Fix

  • Reorders get_token() priority: config["token"] > config["token_file"] > .timmy_gitea_token
  • Adds Path.exists monkeypatch in test_returns_none_when_no_token to isolate from repo-root state

2883 passed, 0 failed after fix.

## What Fixes 2 test failures on main in `test_health_snapshot.py`. ## Root cause `get_token()` checked `.timmy_gitea_token` in repo root BEFORE the config-provided `token_file`. On any dev machine with the real token file present, tests that pass a dummy config path got the real token instead. ## Fix - Reorders `get_token()` priority: `config["token"]` > `config["token_file"]` > `.timmy_gitea_token` - Adds `Path.exists` monkeypatch in `test_returns_none_when_no_token` to isolate from repo-root state 2883 passed, 0 failed after fix.
Timmy added 1 commit 2026-03-22 01:52:37 +00:00
fix: get_token() priority order — config token_file before repo-root fallback
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
38aa33defd
The .timmy_gitea_token file in repo root was checked BEFORE config-provided
token_file, causing tests to leak real tokens and fail on any machine with
the file present.

Reorders priority: config[token] > config[token_file] > .timmy_gitea_token
Adds Path.exists monkeypatch in test_returns_none_when_no_token to isolate
from repo-root state.

Fixes 2 test failures on main.
Timmy merged commit 77a8fc8b96 into main 2026-03-22 01:52:41 +00:00
Timmy deleted branch fix/test-failures-on-main 2026-03-22 01:52:41 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#899