Skip to content

ttk: GUI tests fail on Ubuntu #74941

Description

@csabella
BPO 30756
Nosy @terryjreedy, @serhiy-storchaka, @csabella, @DahlitzFlorian

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 = None
created_at = <Date 2017-06-25.19:02:20.478>
labels = ['3.7', 'tests', 'type-bug', 'expert-tkinter']
title = 'ttk: GUI tests fail on Ubuntu'
updated_at = <Date 2020-05-23.14:22:52.586>
user = 'https://github.com/csabella'

bugs.python.org fields:

activity = <Date 2020-05-23.14:22:52.586>
actor = 'DahlitzFlorian'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tests', 'Tkinter']
creation = <Date 2017-06-25.19:02:20.478>
creator = 'cheryl.sabella'
dependencies = []
files = []
hgrepos = []
issue_num = 30756
keywords = []
message_count = 4.0
messages = ['296835', '296843', '369717', '369722']
nosy_count = 4.0
nosy_names = ['terry.reedy', 'serhiy.storchaka', 'cheryl.sabella', 'DahlitzFlorian']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue30756'
versions = ['Python 3.7']

Activity

  1. csabella commented on Jun 25, 2017

    @csabella
    ContributorAuthor

    Running the tests over up to date build on Ubuntu 16.04 64-bit.

    ./python -m test.test_ttk_guionly -v

    Sometimes this runs without failure and sometimes it 'hangs' and then produces failures. When it hangs, my computer freezes completely. As you can see, it can run for 8 minutes.

    It seems to hang most often on test_idenify in EntryTest.

    Here's one set of failures:

    ======================================================================
    FAIL: test_identify (tkinter.test.test_ttk.test_widgets.EntryTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 332, in test_identify
        self.assertEqual(self.entry.identify(5, 5), "textarea")
    AssertionError: '' != 'textarea'
    + textarea

    ======================================================================
    FAIL: test_get (tkinter.test.test_ttk.test_widgets.ScaleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 807, in test_get
        self.assertEqual(self.scale.get(scale_width, 0), self.scale['to'])
    AssertionError: 0.0 != 1.0

    ======================================================================
    FAIL: test_set (tkinter.test.test_ttk.test_widgets.ScaleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 849, in test_set
        self.assertEqual(conv(self.scale.get(self.scale.winfo_width(), 0)), max)
    AssertionError: 0.0 != 1.0

    ======================================================================
    FAIL: test_identify (tkinter.test.test_ttk.test_widgets.WidgetTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 71, in test_identify
        ), "label")
    AssertionError: '' != 'label'
    + label

    Ran 272 tests in 491.572s

    FAILED (failures=4)

    Here's another set from a different run:

    ======================================================================
    FAIL: test_get (tkinter.test.test_ttk.test_widgets.ScaleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 807, in test_get
        self.assertEqual(self.scale.get(scale_width, 0), self.scale['to'])
    AssertionError: 0.0 != 1.0

    ======================================================================
    FAIL: test_set (tkinter.test.test_ttk.test_widgets.ScaleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 849, in test_set
        self.assertEqual(conv(self.scale.get(self.scale.winfo_width(), 0)), max)
    AssertionError: 0.0 != 1.0

    ======================================================================
    FAIL: test_identify (tkinter.test.test_ttk.test_widgets.WidgetTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", line 71, in test_identify
        ), "label")
    AssertionError: '' != 'label'
    + label

    ======================================================================
    FAIL: test_horizontal_range (tkinter.test.test_ttk.test_extensions.LabeledScaleTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/home/cheryl/cpython/Lib/tkinter/test/test_ttk/test_extensions.py", line 122, in test_horizontal_range
        self.assertEqual(prev_xcoord, int(linfo_1['x']))
    AssertionError: 16 != 1

    Ran 272 tests in 353.180s

    FAILED (failures=4)

  2. changed the title [-]GUI tests fail on Ubuntu[/-] [+]ttk: GUI tests fail on Ubuntu[/+] on Jun 26, 2017
  3. terryjreedy commented on Jun 26, 2017

    @terryjreedy
    Member

    My Win 10 machine consistently runs 272 tests OK in 3 seconds.

  4. terryjreedy commented on May 23, 2020

    @terryjreedy
    Member

    bpo-40722 is about a hang, at least once, on line 147

        def test_variable_change(self):
            x = ttk.LabeledScale(self.root)
            x.pack()
            x.wait_visibility()  # Here.
  5. DahlitzFlorian commented on May 23, 2020

    DahlitzFlorianmannequin
    Mannequin

    I'm on Ubuntu 20.04 64-bit, ran the command provided and got

    Ran 303 tests in 18.900s

    OK

    I was running against the master branch.

  6. transferred this issue fromon Apr 10, 2022
  7. serhiy-storchaka commented on Jul 5, 2026

    @serhiy-storchaka
    Member

    These failures are all fixed by the test hardening in gh-69134 (#152499, backported to 3.13/3.14/3.15).

    The named tests no longer assert on unmapped geometry or block on wait_visibility(); they now wait for the window manager to map the widget (or skip cleanly):

    • EntryTest.test_identify ('' != 'textarea') and ScaleTest.test_get/test_set now guard the geometry assertions with wait_until_mapped().
    • The LabeledScale hang at wait_visibility() (bpo-40722) is gone — that test uses require_mapped() instead, which never blocks indefinitely.

    Closing as completed.

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

    3.7 (EOL)end of lifetestsTests in the Lib/test dirtopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions