Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: configdialog - add tests for ConfigDialog GUI. #74963

Closed
terryjreedy opened this issue Jun 26, 2017 · 18 comments
Closed

IDLE: configdialog - add tests for ConfigDialog GUI. #74963

terryjreedy opened this issue Jun 26, 2017 · 18 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 30780
Nosy @terryjreedy, @mlouielu, @csabella, @miss-islington
PRs
  • bpo-30780: Fix error in idlelib.test_idle.test_configdialog #2606
  • [3.6] bpo-30780: Fix error in idlelib.test_idle.test_configdialog (GH… #2613
  • bpo-30617: IDLE: docstrings and unittest for outwin.py #2046
  • bpo-30780: IDLE: Fix for configdialog test with messagebox #3222
  • bpo-30781: IDLE: Fix help button on configdialog #3238
  • bpo-30780: Add IDLE configdialog tests #3592
  • [3.7] bpo-30780: Add IDLE configdialog tests (GH-3592) #18218
  • [3.8] bpo-30780: Add IDLE configdialog tests (GH-3592) #18219
  • Dependencies
  • bpo-30779: IDLE: configdialog -- factor out Changes class
  • bpo-30870: IDLE: configdialog/fonts: change font when select by key up/down
  • bpo-30981: IDLE: Test config dialog font bold button and sample change
  • bpo-30993: IDLE: Document, fix, and complete configdialog font tests
  • bpo-31001: IDLE: Add tests for configdialog highlight tab
  • bpo-31002: IDLE: Add tests for configdialog keys tab
  • bpo-31003: IDLE: Add tests for help sources on configdialog general tab
  • bpo-31287: IDLE configdialog tests: don't modify tkinter.messagebox.
  • bpo-31414: IDLE: Entry tests should delete before insert.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = <Date 2020-01-27.23:38:45.436>
    created_at = <Date 2017-06-26.22:38:31.231>
    labels = ['3.8', 'expert-IDLE', 'type-feature', '3.7', '3.9']
    title = 'IDLE: configdialog - add tests for ConfigDialog GUI.'
    updated_at = <Date 2020-01-27.23:38:45.434>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2020-01-27.23:38:45.434>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2020-01-27.23:38:45.436>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2017-06-26.22:38:31.231>
    creator = 'terry.reedy'
    dependencies = ['30779', '30870', '30981', '30993', '31001', '31002', '31003', '31287', '31414']
    files = []
    hgrepos = []
    issue_num = 30780
    keywords = ['patch']
    message_count = 18.0
    messages = ['296963', '297016', '297247', '297250', '297838', '297852', '297853', '297855', '300906', '300922', '301037', '301849', '302171', '302225', '307206', '360810', '360815', '360816']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'louielu', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['2606', '2613', '2046', '3222', '3238', '3592', '18218', '18219']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30780'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @terryjreedy
    Copy link
    Member Author

    A complete test of the GUI will simulate user interaction with every widget and then query Changes() to see that the proper changes orders have been recorded.

    This issue depends on bpo-30779, factor out Changes class.

    @terryjreedy terryjreedy added 3.7 (EOL) end of life type-feature A feature request or enhancement topic-IDLE labels Jun 26, 2017
    @terryjreedy terryjreedy self-assigned this Jun 26, 2017
    @terryjreedy
    Copy link
    Member Author

    Tests should be tested on MacOS before being pushed. A possible issue is including constants that are different on different systems. See bpo-28572

    @mlouielu
    Copy link
    Mannequin

    mlouielu mannequin commented Jun 29, 2017

    I'm trying to add the test on configdialog, currently working on KeysTest.

    @terryjreedy
    Copy link
    Member Author

    Proceed as you want. Keep in mind that the interface to the changes structure will be changed by bpo-30779. The testing logic should not be, however.

    @terryjreedy
    Copy link
    Member Author

    PR to fix type in moduleTearDown.

    @terryjreedy
    Copy link
    Member Author

    New changeset 25a4206 by terryjreedy in branch 'master':
    bpo-30780: Fix error in idlelib.test_idle.test_configdialog (bpo-2606)
    25a4206

    @terryjreedy
    Copy link
    Member Author

    I posted PR 2612 for bpo-30779 and expect to merge it tomorrow after sleep and final review. It includes passing revisions of existing configdialog tests. A PR dependent on 2612 could be posted before I do the merge.

    Follow the model of using xyzpage names in asserts and tests would survive the refactoring of ConfigChanges discussed as a possibility on bpo-30779. I want to move forward on this, but not duplicate your work, so please post work done and immediate plans.

    @terryjreedy
    Copy link
    Member Author

    New changeset df0f993 by terryjreedy in branch '3.6':
    [3.6] bpo-30780: Fix error in idlelib.test_idle.test_configdialog (GH-2606) (bpo-2613)
    df0f993

    @terryjreedy
    Copy link
    Member Author

    This issue is almost done. There are just a few things missed by the closed dependencies.

    @terryjreedy
    Copy link
    Member Author

    bpo-31001 and bpo-31002 have notes on what not tested in HighPage and KeysPage.

    @csabella
    Copy link
    Contributor

    I've started working on the missing tests for HighPage and KeysPage and also test for the functions and buttons in ConfigDialog. That led to PR3238 because the 'help' button wasn't working.

    Anyway, I found the following on http://effbot.org/tkinterbook/tkinter-events-and-bindings.htm:

    "An easier solution is to prevent Tkinter from propagating the event to other handlers; just return the string “break” from your event handler:

    def ignore(event):
        return "break"
    text.bind("<Return>", ignore)
    or

    text.bind("<Return>", lambda e: "break")"

    So, it seems that the 'Double-Button-1' and 'B1-Motion' bindings are to prevent those events from propagating outside of the widget. Although, I didn't notice a difference when I commented them out, so maybe they don't have a higher level binding.

    @terryjreedy
    Copy link
    Member Author

    I just pushed the extension conversion patch. The tests we did already were greatly helpful, and some tests not done or inadequate hindered. I am now looking to polish configdialog before 3.6.3. If you have anything worth a new issue and PR, I will be ready to review.

    @csabella
    Copy link
    Contributor

    Sorry I don't have any tests yet. I've added a few, but it's taking me forever to figure out the bindings for testing the Double-Button-1 and B1-Motion. I actually have a test for Double-Button-1 now, but still working on B1-Motion.

    @csabella
    Copy link
    Contributor

    I've submitted a PR for the tests that I added to complete coverage for Keys and Highlights and to add some GUI tests for the buttons. It's not everything that I wanted to do, but it ended up being more substantial than I realized.

    Here's the issue I was having with testing Double-Button-1 and B1-Motion. After the first ButtonPress and ButtonRelease, the second (or later) event-generate always looked like it was a double click (it probably was really a triple click or higher, depending how many times I tried it). I tried everything I could think of or find online, but I couldn't find how to reset the counts to start over and make it think it was a just ButtonPress and not a Double-Button.

    This was OK for the testing on Double-Button, but it was causing the B1-Motion not to work because it was not seeing each 'movement' as a press/move/release, but rather a double-button/move/release. It was OK because the Double also invokes the Press callback, however, since the Double event was bound to break, it didn't allow the text to be selected. (The difference between Double and B1-Motion is that Double selects a word and B1-Motion selects where the mouse moves).

    I played with it in IDLE and I could reset the Press by doing an event-generate on a different (x, y), but that didn't work in the test. I tried a delay and it still didn't fix it.

    Anyway, I've learned a lot about mouse binding while working on this, but without a solution, I cheated and just did ButtonPress on a different (x, y) for the second test.

    Sorry about the rambling, but I'd love to know the trick to resetting the number of button presses in a test.

    @terryjreedy
    Copy link
    Member Author

    Review of overview:
    PR-2706 and PR-2613 fixed one line in test_configdialog for this issue.
    PR-2046, bpo-30617 and PR-3238, bpo-30781 are merged cross-references.
    PR-3222 was closed in favor of PR-3220, bpo-31287, merged.

    PR-3592 completes highlights and keys coverage and needs my review after getting lost in the flurry of PRs.

    Dependency bpo-31414 has merged PRs. I should review, close, or indicate what is left to do.

    Other dependencies are closed and I believe this should be after handling above 2 items.

    @terryjreedy
    Copy link
    Member Author

    New changeset dd023ad by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-30780: Add IDLE configdialog tests (bpo-3592)
    dd023ad

    @miss-islington
    Copy link
    Contributor

    New changeset 5aefee6 by Miss Islington (bot) in branch '3.7':
    bpo-30780: Add IDLE configdialog tests (GH-3592)
    5aefee6

    @miss-islington
    Copy link
    Contributor

    New changeset 7b57b15 by Miss Islington (bot) in branch '3.8':
    bpo-30780: Add IDLE configdialog tests (GH-3592)
    7b57b15

    @terryjreedy terryjreedy added 3.8 only security fixes 3.9 only security fixes labels Jan 27, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants