[Python-checkins] [3.11] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) (#105029)

terryjreedy webhook-mailer at python.org
Sat May 27 17:52:21 EDT 2023


https://github.com/python/cpython/commit/dcfa8165ad3444f4c9ea3d8cb0f9f0a007e9937b
commit: dcfa8165ad3444f4c9ea3d8cb0f9f0a007e9937b
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: terryjreedy <tjreedy at udel.edu>
date: 2023-05-27T17:52:14-04:00
summary:

[3.11] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) (#105029)

For test_widgets.MenuTest.test_configure_type, the options
in the error message change to alphabetical order.
---------

(cherry picked from commit 897e716d03d559a10dd5015ecb501ceb98955f3a)

Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

files:
M Lib/tkinter/test/test_tkinter/test_widgets.py

diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index f0149153512fb..2a5913521fbe1 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -1403,10 +1403,13 @@ def test_configure_title(self):
 
     def test_configure_type(self):
         widget = self.create()
+        opts = ('normal, tearoff, or menubar'
+                if widget.info_patchlevel() < (8, 7) else
+                'menubar, normal, or tearoff')
         self.checkEnumParam(
             widget, 'type',
             'normal', 'tearoff', 'menubar',
-            errmsg='bad type "{}": must be normal, tearoff, or menubar',
+            errmsg='bad type "{}": must be ' + opts,
             )
 
     def test_entryconfigure(self):



More information about the Python-checkins mailing list