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

test_tk test_widgets.ScaleTest fails with Tk 8.6.10 #85478

Closed
felixonmars mannequin opened this issue Jul 15, 2020 · 11 comments
Closed

test_tk test_widgets.ScaleTest fails with Tk 8.6.10 #85478

felixonmars mannequin opened this issue Jul 15, 2020 · 11 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir topic-tkinter

Comments

@felixonmars
Copy link
Mannequin

felixonmars mannequin commented Jul 15, 2020

BPO 41306
Nosy @terryjreedy, @ned-deily, @ambv, @serhiy-storchaka, @felixonmars, @miss-islington, @E-Paine
PRs
  • bpo-41306: Allow scale value to not be rounded #21715
  • [3.8] bpo-41306: Allow scale value to not be rounded (GH-21715) #22596
  • [3.9] bpo-41306: Allow scale value to not be rounded (GH-21715) #22597
  • 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 = None
    closed_at = <Date 2020-10-08.17:16:27.973>
    created_at = <Date 2020-07-15.19:12:33.815>
    labels = ['tests', '3.8', 'expert-tkinter', '3.9', '3.10']
    title = 'test_tk test_widgets.ScaleTest fails with Tk 8.6.10'
    updated_at = <Date 2020-10-08.17:16:27.972>
    user = 'https://github.com/felixonmars'

    bugs.python.org fields:

    activity = <Date 2020-10-08.17:16:27.972>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-08.17:16:27.973>
    closer = 'pablogsal'
    components = ['Tests', 'Tkinter']
    creation = <Date 2020-07-15.19:12:33.815>
    creator = 'felixonmars'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41306
    keywords = ['patch']
    message_count = 11.0
    messages = ['373710', '373767', '373768', '373780', '374531', '374733', '374741', '377509', '378250', '378254', '378257']
    nosy_count = 8.0
    nosy_names = ['terry.reedy', 'gpolo', 'ned.deily', 'lukasz.langa', 'serhiy.storchaka', 'felixonmars', 'miss-islington', 'epaine']
    pr_nums = ['21715', '22596', '22597']
    priority = 'critical'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue41306'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @felixonmars
    Copy link
    Mannequin Author

    felixonmars mannequin commented Jul 15, 2020

    test_from (tkinter.test.test_tkinter.test_widgets.ScaleTest) is currently failing on Arch Linux, and at least another place: https://python-build-standalone.readthedocs.io/en/latest/status.html

    The error looks like:

    ======================================================================
    FAIL: test_from (tkinter.test.test_tkinter.test_widgets.ScaleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/usr/lib/python3.8/tkinter/test/test_tkinter/test_widgets.py", line 939, in test_from
        self.checkFloatParam(widget, 'from', 100, 14.9, 15.1, conv=float_round)
      File "/usr/lib/python3.8/tkinter/test/widget_tests.py", line 106, in checkFloatParam
        self.checkParam(widget, name, value, conv=conv, **kwargs)
      File "/usr/lib/python3.8/tkinter/test/widget_tests.py", line 64, in checkParam
        self.assertEqual2(widget.cget(name), expected, eq=eq)
      File "/usr/lib/python3.8/tkinter/test/widget_tests.py", line 47, in assertEqual2
        self.assertEqual(actual, expected, msg)
    AssertionError: 14.9 != 15.0

    It's the only failure in the current Python 3.8.4 release's test suite here. Also adding Python 3.9 and 3.10 as I am able to reproduce it on master too.

    @felixonmars felixonmars mannequin added 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir labels Jul 15, 2020
    @ned-deily
    Copy link
    Member

    What version of Tk is being used? It's in the output from:
    python3 -m test.pythoninfo
    or however you invoke python.

    @felixonmars
    Copy link
    Mannequin Author

    felixonmars mannequin commented Jul 16, 2020

    tkinter.TCL_VERSION: 8.6
    tkinter.TK_VERSION: 8.6
    tkinter.info_patchlevel: 8.6.10

    It's always reproducible in either a real desktop or Xvfb with arbitrary resolution etc as far as I have tested.

    @ned-deily
    Copy link
    Member

    I can reproduce that test failure with Tk 8.6.10 on macOS, along with a few others. I believe various small things have changed in Tk somewhere between 8.6.8 and 8.6.10 in ways that affect some of the Python Tk gui tests, like test_tk and test_ttk_guionly. Some of our tests are pretty brittle with regard to Tk behavior; they captured how a particular version of Tk worked without necessarily a guarantee on the Tk side that the observed behavior wouldn't change. Someone needs to go through and make the tests work with all recent versions of Tk 8.6.x and someone should also get at least some buildbots running with 8.6.10 and really running the gui tests.

    @ned-deily ned-deily changed the title test_tk failure on Arch Linux test_tk test_widgets.ScaleTest fails with Tk 8.6.10 Jul 16, 2020
    @ned-deily ned-deily changed the title test_tk failure on Arch Linux test_tk test_widgets.ScaleTest fails with Tk 8.6.10 Jul 16, 2020
    @ned-deily
    Copy link
    Member

    This issue should be fixed for upcoming releases. Nosying Łukasz for consideration of "release blocker" status.

    @E-Paine
    Copy link
    Mannequin

    E-Paine mannequin commented Aug 3, 2020

    +1 this issue. I have encountered this problem lots when testing patches and almost always just end up deleting the test_from method to get test_tk to pass. I am not sure of a solution, though, as we *need* to keep test compatibility with Tk 8.6.8 while (preferably) being able to recognise when the value is wrong for the given version. I hope to take a more in-depth look at the problem and possible solutions (I want to avoid, if possible, either checking the Tk version or allowing both 14.9 & 15.0 values to pass the test).

    @E-Paine E-Paine mannequin added topic-tkinter labels Aug 3, 2020
    @E-Paine
    Copy link
    Mannequin

    E-Paine mannequin commented Aug 3, 2020

    For reference, I have opened https://core.tcl-lang.org/tk/tktview?name=81c3ef93148d17ff280d9a0b4c4edfce453b972f to report this to the Tk team and ask if this change in behaviour is intended.

    @terryjreedy
    Copy link
    Member

    Fixing this test bug is required to upgrade tk on Windows. bpo-39107 and PR 22405.

    E. Paine reported on the PR 21715 that this change is intentional and here to stay. I wondered the same; thank you for asking.

    @miss-islington
    Copy link
    Contributor

    New changeset aecf036 by E-Paine in branch 'master':
    bpo-41306: Allow scale value to not be rounded (GH-21715)
    aecf036

    @miss-islington
    Copy link
    Contributor

    New changeset 3d103e0 by Miss Skeleton (bot) in branch '3.8':
    bpo-41306: Allow scale value to not be rounded (GH-21715)
    3d103e0

    @miss-islington
    Copy link
    Contributor

    New changeset 15e091f by Miss Skeleton (bot) in branch '3.9':
    bpo-41306: Allow scale value to not be rounded (GH-21715)
    15e091f

    @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.8 only security fixes 3.9 only security fixes 3.10 only security fixes tests Tests in the Lib/test dir topic-tkinter
    Projects
    None yet
    Development

    No branches or pull requests

    4 participants