cpython: Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
http://hg.python.org/cpython/rev/de4d34a95603 changeset: 70510:de4d34a95603 parent: 70507:2413cffc8941 user: Ned Deily <nad@acm.org> date: Sun May 29 15:28:54 2011 -0700 summary: Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9 on Mac OS X. (Patch by Ronald Oussoren) files: Lib/tkinter/test/test_ttk/test_widgets.py | 20 ++++++++-- Misc/NEWS | 3 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Lib/tkinter/test/test_ttk/test_widgets.py b/Lib/tkinter/test/test_ttk/test_widgets.py --- a/Lib/tkinter/test/test_ttk/test_widgets.py +++ b/Lib/tkinter/test/test_ttk/test_widgets.py @@ -3,6 +3,7 @@ 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 @@ 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 @@ 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)) diff --git a/Misc/NEWS b/Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS @@ -770,6 +770,9 @@ Tests ----- +- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9 + on Mac OS X. (Patch by Ronald Oussoren) + - Issue #12180: Fixed a few remaining errors in test_packaging when no threading. -- Repository URL: http://hg.python.org/cpython
participants (1)
-
ned.deily