mirror of https://github.com/python/cpython
Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
on Mac OS X. (Patch by Ronald Oussoren)
This commit is contained in:
parent
68b543aa02
commit
11f00f3b00
|
@ -3,6 +3,7 @@ import tkinter
|
||||||
import os
|
import os
|
||||||
from tkinter import ttk
|
from tkinter import ttk
|
||||||
from test.support import requires, run_unittest
|
from test.support import requires, run_unittest
|
||||||
|
import sys
|
||||||
|
|
||||||
import tkinter.test.support as support
|
import tkinter.test.support as support
|
||||||
from tkinter.test.test_ttk.test_functions import MockTclObj, MockStateSpec
|
from tkinter.test.test_ttk.test_functions import MockTclObj, MockStateSpec
|
||||||
|
@ -561,11 +562,19 @@ class NotebookTest(unittest.TestCase):
|
||||||
|
|
||||||
self.nb.pack()
|
self.nb.pack()
|
||||||
self.nb.wait_visibility()
|
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):
|
for i in range(5, 100, 5):
|
||||||
if self.nb.tab('@%d, 5' % i, text=None) == 'a':
|
try:
|
||||||
break
|
if self.nb.tab('@%d, 5' % i, text=None) == 'a':
|
||||||
|
break
|
||||||
|
except tkinter.TclError:
|
||||||
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.fail("Tab with text 'a' not found")
|
self.fail("Tab with text 'a' not found")
|
||||||
|
|
||||||
|
@ -722,7 +731,10 @@ class NotebookTest(unittest.TestCase):
|
||||||
self.nb.enable_traversal()
|
self.nb.enable_traversal()
|
||||||
self.nb.focus_force()
|
self.nb.focus_force()
|
||||||
support.simulate_mouse_click(self.nb, 5, 5)
|
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))
|
self.assertEqual(self.nb.select(), str(self.child1))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,9 @@ Build
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
|
||||||
|
on Mac OS X. (Patch by Ronald Oussoren)
|
||||||
|
|
||||||
- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
|
- Issue #12057: Add tests for ISO 2022 codecs (iso2022_jp, iso2022_jp_2,
|
||||||
iso2022_kr).
|
iso2022_kr).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue