summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-06-28 06:18:45 (GMT)
committerNed Deily <nad@acm.org>2011-06-28 06:18:45 (GMT)
commitf6837aa1714ff331346522c6698573d9d32aa43e (patch)
treed6d585008512c32f0b8c599c42529c717342b42a /Lib/tkinter
parent4177eff0884154bb69d8bfd4daaa5987cba58c27 (diff)
parent11f00f3b00a0667c41509318f49f0da75ab5c977 (diff)
downloadcpython-f6837aa1714ff331346522c6698573d9d32aa43e.zip
cpython-f6837aa1714ff331346522c6698573d9d32aa43e.tar.gz
cpython-f6837aa1714ff331346522c6698573d9d32aa43e.tar.bz2
Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
2.8 + on Mac OS X. (Patch by Ronald Oussoren)
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/test/test_ttk/test_widgets.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py
index cd00a61..f5c0f17 100644
--- a/Lib/tkinter/test/test_ttk/test_widgets.py
+++ b/Lib/tkinter/test/test_ttk/test_widgets.py
@@ -3,6 +3,7 @@ import tkinter
import os
from tkinter import ttk
from test.support import requires, run_unittest
+import sys
import tkinter.test.support as support
from tkinter.test.test_ttk.test_functions import MockTclObj, MockStateSpec
@@ -561,11 +562,19 @@ class NotebookTest(unittest.TestCase):
self.nb.pack()
self.nb.wait_visibility()
- self.assertEqual(self.nb.tab('@5,5'), self.nb.tab('current'))
+ if sys.platform == 'darwin':
+ tb_idx = "@20,5"
+ else:
+ tb_idx = "@5,5"
+ self.assertEqual(self.nb.tab(tb_idx), self.nb.tab('current'))
for i in range(5, 100, 5):
- if self.nb.tab('@%d, 5' % i, text=None) == 'a':
- break
+ try:
+ if self.nb.tab('@%d, 5' % i, text=None) == 'a':
+ break
+ except tkinter.TclError:
+ pass
+
else:
self.fail("Tab with text 'a' not found")
@@ -722,7 +731,10 @@ class NotebookTest(unittest.TestCase):
self.nb.enable_traversal()
self.nb.focus_force()
support.simulate_mouse_click(self.nb, 5, 5)
- self.nb.event_generate('<Alt-a>')
+ if sys.platform == 'darwin':
+ self.nb.event_generate('<Option-a>')
+ else:
+ self.nb.event_generate('<Alt-a>')
self.assertEqual(self.nb.select(), str(self.child1))