[Python-checkins] bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH-12011)

Miss Islington (bot) webhook-mailer at python.org
Sun Feb 24 02:46:24 EST 2019


https://github.com/python/cpython/commit/25d20a6503f3cd4ff8cf0e8ee33eea2b1daa77a8
commit: 25d20a6503f3cd4ff8cf0e8ee33eea2b1daa77a8
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-02-23T23:46:20-08:00
summary:

bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH-12011)

(cherry picked from commit aeca373b339e0ea9739536ce6b43bd90f3b89873)

Co-authored-by: Ned Deily <nad at python.org>

files:
A Misc/NEWS.d/next/Tests/2019-02-24-01-58-38.bpo-27313.Sj9veH.rst
M Lib/tkinter/test/test_ttk/test_widgets.py

diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py
index 06e3dfe70d5d..ba9e3b54f78e 100644
--- a/Lib/tkinter/test/test_ttk/test_widgets.py
+++ b/Lib/tkinter/test/test_ttk/test_widgets.py
@@ -329,7 +329,12 @@ def test_identify(self):
         self.entry.wait_visibility()
         self.entry.update_idletasks()
 
-        self.assertEqual(self.entry.identify(5, 5), "textarea")
+        # bpo-27313: macOS Cocoa widget differs from X, allow either
+        if sys.platform == 'darwin':
+            self.assertIn(self.entry.identify(5, 5),
+                ("textarea", "Combobox.button") )
+        else:
+            self.assertEqual(self.entry.identify(5, 5), "textarea")
         self.assertEqual(self.entry.identify(-1, -1), "")
 
         self.assertRaises(tkinter.TclError, self.entry.identify, None, 5)
diff --git a/Misc/NEWS.d/next/Tests/2019-02-24-01-58-38.bpo-27313.Sj9veH.rst b/Misc/NEWS.d/next/Tests/2019-02-24-01-58-38.bpo-27313.Sj9veH.rst
new file mode 100644
index 000000000000..189b9cf69f07
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-02-24-01-58-38.bpo-27313.Sj9veH.rst
@@ -0,0 +1 @@
+Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa Tk.



More information about the Python-checkins mailing list