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

terryjreedy webhook-mailer at python.org
Sat May 27 15:24:09 EDT 2023


https://github.com/python/cpython/commit/897e716d03d559a10dd5015ecb501ceb98955f3a
commit: 897e716d03d559a10dd5015ecb501ceb98955f3a
branch: main
author: Terry Jan Reedy <tjreedy at udel.edu>
committer: terryjreedy <tjreedy at udel.edu>
date: 2023-05-27T19:23:56Z
summary:

gh-104497: Make tkinter test pass with tk 8.7 (#104789)

* gh-104497: Make tkinter test pass with tk 8.7

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

* Update Lib/test/test_tkinter/test_widgets.py

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

---------

Co-authored-by: Serhiy Storchaka <storchaka at gmail.com>

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

diff --git a/Lib/test/test_tkinter/test_widgets.py b/Lib/test/test_tkinter/test_widgets.py
index 76cc16e5b977d..34e67c0cbc44a 100644
--- a/Lib/test/test_tkinter/test_widgets.py
+++ b/Lib/test/test_tkinter/test_widgets.py
@@ -1408,10 +1408,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