]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-104497: Make tkinter test pass with tk 8.7 (GH-104789) (#105029)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 27 May 2023 21:52:14 +0000 (14:52 -0700)
committerGitHub <noreply@github.com>
Sat, 27 May 2023 21:52:14 +0000 (17:52 -0400)
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@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/tkinter/test/test_tkinter/test_widgets.py

index f0149153512fb58adcf72827139d93b6da25ba79..2a5913521fbe13ce71a87f378ef3f47eb4353eed 100644 (file)
@@ -1403,10 +1403,13 @@ class MenuTest(AbstractWidgetTest, unittest.TestCase):
 
     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):