]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[2.7] bpo-27313: Avoid test_ttk_guionly ComboboxTest fail with macOS Cocoa Tk (GH...
authorNed Deily <nad@python.org>
Sun, 24 Feb 2019 08:33:19 +0000 (03:33 -0500)
committerGitHub <noreply@github.com>
Sun, 24 Feb 2019 08:33:19 +0000 (03:33 -0500)
Lib/lib-tk/test/test_ttk/test_widgets.py
Misc/NEWS.d/next/Tests/2019-02-24-03-19-43.bpo-27313.Sj9veH.rst [new file with mode: 0644]

index ec8899baac2425d2172b284455ef49c4996f7af2..47cd7aff0e27b82cec1f83548cf99c92c231eb70 100644 (file)
@@ -331,7 +331,12 @@ class EntryTest(AbstractWidgetTest, unittest.TestCase):
         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-03-19-43.bpo-27313.Sj9veH.rst b/Misc/NEWS.d/next/Tests/2019-02-24-03-19-43.bpo-27313.Sj9veH.rst
new file mode 100644 (file)
index 0000000..189b9cf
--- /dev/null
@@ -0,0 +1 @@
+Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa Tk.