Title: test_tk test_widgets.ScaleTest fails with Tk 8.6.10
Type: Stage: patch review
Components: Tests, Tkinter Versions: Python 3.10, Python 3.9, Python 3.8
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: epaine, felixonmars, gpolo, lukasz.langa, ned.deily, serhiy.storchaka
Priority: critical Keywords: patch

Created on 2020-07-15 19:12 by felixonmars, last changed 2020-08-03 16:56 by epaine.

Pull Requests
URL Status Linked Edit
PR 21715 open epaine, 2020-08-03 13:01
Messages (7)
msg373710 - (view) Author: Felix Yan (felixonmars) * Date: 2020-07-15 19:12
test_from (tkinter.test.test_tkinter.test_widgets.ScaleTest) is currently failing on Arch Linux, and at least another place:

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/", line 939, in test_from
    self.checkFloatParam(widget, 'from', 100, 14.9, 15.1, conv=float_round)
  File "/usr/lib/python3.8/tkinter/test/", line 106, in checkFloatParam
    self.checkParam(widget, name, value, conv=conv, **kwargs)
  File "/usr/lib/python3.8/tkinter/test/", line 64, in checkParam
    self.assertEqual2(widget.cget(name), expected, eq=eq)
  File "/usr/lib/python3.8/tkinter/test/", 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.
msg373767 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-07-16 20:14
What version of Tk is being used?  It's in the output from:
  python3 -m test.pythoninfo
or however you invoke python.
msg373768 - (view) Author: Felix Yan (felixonmars) * Date: 2020-07-16 20:33
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.
msg373780 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-07-16 22:26
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.
msg374531 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-07-28 21:18
This issue should be fixed for upcoming releases. Nosying Ɓukasz for consideration of "release blocker" status.
msg374733 - (view) Author: E. Paine (epaine) * Date: 2020-08-03 10:17
+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).
msg374741 - (view) Author: E. Paine (epaine) * Date: 2020-08-03 16:56
For reference, I have opened to report this to the Tk team and ask if this change in behaviour is intended.
Date User Action Args
2020-08-03 16:56:53epainesetmessages: + msg374741
2020-08-03 13:01:45epainesetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request20859
2020-08-03 10:17:45epainesetnosy: + epaine
messages: + msg374733
components: + Tkinter
2020-07-28 21:18:45ned.deilysetpriority: normal -> critical
nosy: + lukasz.langa
messages: + msg374531

2020-07-28 21:15:27ned.deilylinkissue41405 superseder
2020-07-16 22:26:49ned.deilysetnosy: + gpolo, serhiy.storchaka
title: test_tk failure on Arch Linux -> test_tk test_widgets.ScaleTest fails with Tk 8.6.10
messages: + msg373780

stage: needs patch
2020-07-16 20:33:29felixonmarssetmessages: + msg373768
2020-07-16 20:14:59ned.deilysetnosy: + ned.deily
messages: + msg373767
2020-07-15 19:12:33felixonmarscreate