fix(test): optimize Tkinter test suite and configure pytest-tkl-optimizer plugin - #472
Merged
Merged
Conversation
…izer plugin - Add pytest-tkl-optimizer plugin configuration and guidelines in rules/pytest.md - Refactor test_zone_controls_multi_aquarium.py to use canonical tkinter_root fixture and @pytest.mark.gui - Fix test_processing_reports_widget.py::test_right_click_emits_event to be deterministic and avoid unmapped tree skips - Update .gitignore for Windows shortcuts and sync legacy archive documentation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves the reliability and runtime of the Tkinter GUI test suite by standardizing on the canonical Tkinter root fixtures, removing environment-dependent skips, and documenting/packaging local guidance for Tkinter pytest practices. It also tidies archival documentation and ignores Windows .lnk shortcuts.
Changes:
- Standardize Tkinter GUI tests on the shared
tkinter_rootfixture and apply theguimarker consistently. - Make
ProcessingReportsWidgetright-click tests deterministic by mocking tree hit-testing and asserting the exactEventBusV2.publish()call payload. - Refresh legacy archive docs by removing inappropriate-for-public-archive artifacts and updating the archive README; extend
.gitignoreto ignore*.lnk.
Reviewed changes
Copilot reviewed 9 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/ui/test_zone_controls_multi_aquarium.py | Switches tests to the canonical tkinter_root fixture and marks the module as GUI tests. |
| tests/ui/components/test_processing_reports_widget.py | Removes environment-dependent skipping by mocking Treeview hit-testing and asserting deterministic event publishing. |
| docs/archive/legacy/fapesp/README.md | Clarifies what remains in the public legacy archive and what was removed ahead of the archival snapshot. |
| docs/archive/legacy/fapesp/proposals/Projeto_Consolidado_Mudanca_Prorrogacao_Excepcional_v1.md | Removes proposal draft content from repository HEAD (legacy archival cleanup). |
| docs/archive/legacy/fapesp/finance/Tabela Itens e Notas FAPESP - 2025.csv | Removes finance spreadsheet content from repository HEAD (legacy archival cleanup). |
| .mcp.json | Removes a tracked MCP config file (repo already treats it as gitignored configuration). |
| .gitignore | Ignores Windows shortcut files (*.lnk). |
| .agents/plugins/pytest-tkl-optimizer/rules/pytest.md | Adds local guidelines for writing and running non-blocking Tkinter pytest GUI tests. |
| .agents/plugins/pytest-tkl-optimizer/plugin.json | Registers the local agent/plugin metadata for the pytest Tkinter optimizer instructions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1
to
+5
| { | ||
| "$schema": "https://antigravity.google/schemas/v1/plugin.json", | ||
| "name": "pytest-tkl-optimizer", | ||
| "description": "Custom agent instructions for generating non-blocking Tkinter pytests." | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.agents/plugins/pytest-tkl-optimizer/with guidelines inrules/pytest.md.tests/ui/test_zone_controls_multi_aquarium.pyto use canonicaltkinter_rootsession fixture and add@pytest.mark.guimarker.tests/ui/components/test_processing_reports_widget.py::test_right_click_emits_eventdeterministic by mocking tree row/column resolution, eliminating test skipping on unmapped windows and verifying payload assertions againstUIEvents.PROCESSING_REPORTS_ITEM_RIGHT_CLICK..lnkfiles in.gitignoreand sync legacy documentation ahead of the v6.0.0 archival milestone.Validation
pytest -m gui -n0 --no-cov): 1114 passed, 0 skipped, 0 failed in 51.17s (~45% speedup).pytest -m "not (gui or slow or ttkbootstrap_singleton)" --no-cov): 4231 passed in 169.62s.ruff check,ruff format,markdownlint, andmypyall passed with 0 errors.