From afe4b8de87081fcb5f53a7917bf3da62535a5abd Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sat, 27 May 2023 15:23:56 -0400 Subject: [PATCH] gh-104497: Make tkinter test pass with tk 8.7 (GH-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 --------- (cherry picked from commit 897e716d03d559a10dd5015ecb501ceb98955f3a) Co-authored-by: Terry Jan Reedy Co-authored-by: Serhiy Storchaka --- Lib/tkinter/test/test_tkinter/test_widgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py index f0149153512fb5..2a5913521fbe13 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):