Skip to content

test: route all e2e tests through main() entry point#1937

Merged
wkentaro merged 1 commit intomainfrom
test/e2e-main-entry-point
Apr 9, 2026
Merged

test: route all e2e tests through main() entry point#1937
wkentaro merged 1 commit intomainfrom
test/e2e-main-entry-point

Conversation

@wkentaro
Copy link
Copy Markdown
Owner

@wkentaro wkentaro commented Apr 9, 2026

Summary

  • Add main_win factory fixture in tests/e2e/conftest.py that calls labelme.__main__.main() with monkeypatched sys.argv, exercising the full CLI entry point (arg parsing, config loading, translator setup, window creation)
  • Replace all direct MainWindow() construction in 12 e2e test files with main_win() calls
  • Increases __main__.py test coverage from 0% to ~60%

Test plan

  • All 47 e2e tests pass locally (QT_QPA_PLATFORM=offscreen uv run pytest tests/e2e/)
  • All 114 tests pass with make test
  • make lint passes
  • CI green on all platforms

Replace direct MainWindow() construction with a main_win factory fixture
that calls labelme.__main__.main(), exercising the full CLI entry point
(arg parsing, config loading, translator setup, window creation) in
every e2e test. This increases __main__.py coverage from 0% to ~60%.
@wkentaro wkentaro self-assigned this Apr 9, 2026
@wkentaro wkentaro added the test label Apr 9, 2026
@wkentaro wkentaro added this to the v6.1.0 milestone Apr 9, 2026
@wkentaro wkentaro merged commit 5125ac6 into main Apr 9, 2026
5 checks passed
@wkentaro wkentaro deleted the test/e2e-main-entry-point branch April 9, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant