GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Increase test coverage for tkinter.simpledialog · Issue #144106 · python/cpython

Increase test coverage for tkinter.simpledialog #144106

New issue
Copy link
New issue
Copy link
Closed
Closed
Increase test coverage for tkinter.simpledialog#144106
Copy link
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-tkinter

Description

@b9788213
b9788213
opened on Jan 21, 2026
Issue body actions

The tkinter.simpledialog module currently has low test coverage (%46). test_simpledialog only tests askinteger function. I tried askfloat, it works well but askstring throws an unrelated exception.

Linked PRs

  • gh-144106 Add tests to the tkinter #144107

Activity

  1. b9788213
    added a commit that references this issue on Jan 21, 2026

    pythongh-144106 Add tests to the tkinter

    b18b97e
  2. aisk
    added
    testsTests in the Lib/test dirTests in the Lib/test dir
    topic-tkinter
    on Jan 21, 2026
  3. serhiy-storchaka commented on Jan 23, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jan 23, 2026
    Member
    More actions

    What exception?

    It does not look like these tests add much value. There is already a manual test in Lib/tkinter/simpledialog.py. For automatic tests, we need to test the the dialogs are appeared at right position, that entering data in the entry field and pressing the buttons work as expected. This may be possible, but this is not easy.

  4. b9788213 commented on Jan 24, 2026

    @b9788213
    b9788213
    on Jan 24, 2026
    ContributorAuthor
    More actions

    When i tried it something goes wrong in another test file

  5. serhiy-storchaka commented on Jun 27, 2026

    @serhiy-storchaka
    serhiy-storchaka
    on Jun 27, 2026
    Member
    More actions

    Comprehensive tests for tkinter.simpledialog were since added under gh-151678:

    • gh-151678: Add interactive tests for tkinter.simpledialog #151794 — interactive tests for the query dialogs
    • gh-151678: Add tests for tkinter.simpledialog #151856 — further tests
    • gh-59396: Modernize tkinter.simpledialog #151848 (tkinter convenience dialogs don't use themed widgets #59396) — modernization, with matching tests

    test_simpledialog.py is now 44 tests covering askinteger, askfloat and askstring with real entry input and accept/cancel, validation and min/max boundaries, plus the Dialog/SimpleDialog appearance, buttons, accelerators and keyboard traversal. The query dialogs are driven by mocking Dialog.wait_window, so the modal dialog stays alive and can be exercised with generated events — the approach mentioned above. (The askstring exception you saw was test-isolation from a leaked default root, which the test setup now avoids.)

    This covers what was requested, so I'm closing as completed. PR #144107 is superseded by the above and can be closed too. Thanks for raising it.

  6. serhiy-storchaka
    closed this as completedon Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirTests in the Lib/test dirtopic-tkinter

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.