]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104497: Make tkinter test pass with tk 8.7 (#104789)
authorTerry Jan Reedy <tjreedy@udel.edu>
Sat, 27 May 2023 19:23:56 +0000 (15:23 -0400)
committerGitHub <noreply@github.com>
Sat, 27 May 2023 19:23:56 +0000 (19:23 +0000)
* 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@gmail.com>
---------

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_tkinter/test_widgets.py

index 76cc16e5b977dee86e425a1f5a60b314523fbdec..34e67c0cbc44a374198a400079e9ab6ed74093e5 100644 (file)
@@ -1408,10 +1408,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):