fix(tests): replace the blocking wait_window with an on_close callback; correct the dialog-commit assertion #47
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ykp/gensig!47
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-protected-dialog-empty"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to the merged #46 (its CI ran after the merge and reported two failures). Same branch, one new commit (
5747949).1.
test_edit_dialog_commits_on_ok—TclError: bad window path nameThe #46 fix added a blocking
wait_window(dialog)after the dialog constructor. The monkeypatched fake returned an already-destroyed Toplevel, andwait_windowon a destroyed path raisesTclError: bad window path name.Restructure (behavior-preserving, no blocking):
ProtectedBandsDialogtakes an optionalon_closecallback — fired afterdestroy()for OK, Cancel and the WM close button alike (theWM_DELETE_WINDOWprotocol routes to the same dismiss path).self._protected_dialog: ProtectedBandsDialog | None) and refreshes the count label from the callback. The modal behavior stays withgrab_set(afterwait_visibility— the original #46 fix), the gc-reference concern is covered by the held reference, and the refresh-after-close semantics are preserved — minus the blocking wait that monkeypatched tests (and any embedded caller) cannot survive.None).2.
test_real_dialog_opens_with_content—assert 3 == 2The test's own arithmetic: 1 initial + 1 added via
_on_add+ 1 appended = 3 records, asserted 2. Fixed the count and the comment; the copy-vs-project isolation checks stay.Also dropped a bogus
protocol("WM_DELETE_WINDOW")()direct-invoke probe (protocolwith one argument returns the handler string — not callable).Gate
pytest: 1278 passed / 64 skipped (headless tier), coverage 93.51 %ruff+mypy: clean