MIL-009 task 9: fix a flaky unit test that created a real Tk root #66

Merged
Tirsvad merged 3 commits from fix-flaky-unit-test into main 2026-10-14 18:44:11 +02:00
Owner

Fix a flaky unit test: an unpatched app.main call created a real tk.Tk() in a unit test (about 1 failure in 6 full runs). An autouse fixture now uses the module's fake root; real Tk stays covered by the e2e tests. 20 consecutive full runs green (216 tests).

The fix is task 9 of MIL-009 (row added and MIL-009 re-reviewed: RC-050 Go; fix reviewed: RC-049 Go; autonomous mode, not independent).

Closes #65

Fix a flaky unit test: an unpatched `app.main` call created a real `tk.Tk()` in a unit test (about 1 failure in 6 full runs). An autouse fixture now uses the module's fake root; real Tk stays covered by the e2e tests. 20 consecutive full runs green (216 tests). The fix is task 9 of MIL-009 (row added and MIL-009 re-reviewed: RC-050 Go; fix reviewed: RC-049 Go; autonomous mode, not independent). Closes #65
Tirsvad added 3 commits 2026-10-14 18:44:03 +02:00
Task row 9 added to MIL-009 after the merge; review records RC-049
(the fix) and RC-050 (MIL-009 re-review), both Go.
test_main_returns_one_when_word_list_is_missing_with_level called
app.main without a fake root, so a real tk.Tk() was created in a unit
test and failed about 1 in 6 full runs. An autouse fixture now patches
app.tk.Tk with the module's fake root. Review record RC-049 (Go).

Task: MIL-009#9
Tirsvad merged commit 3532e82d86 into main 2026-10-14 18:44:11 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Tirsvad-Udemy-100-days-of-code/031-flash-card#66