Skip to content

Commit

Permalink
Allow both macos specific and generic id
Browse files Browse the repository at this point in the history
  • Loading branch information
erlend-aasland committed Oct 11, 2024
1 parent 06a8d8c commit 4ae24de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_ttk/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class EntryTest(AbstractWidgetTest, unittest.TestCase):
'show', 'state', 'style', 'takefocus', 'textvariable',
'validate', 'validatecommand', 'width', 'xscrollcommand',
)
IDENTIFY_AS = 'Entry.field' if sys.platform == 'darwin' else 'textarea'
IDENTIFY_AS = {'Entry.field', 'textarea'}

def setUp(self):
super().setUp()
Expand Down Expand Up @@ -374,7 +374,7 @@ def test_identify(self):
self.entry.update()

# bpo-27313: macOS Cocoa widget differs from X, allow either
self.assertEqual(self.entry.identify(5, 5), self.IDENTIFY_AS)
self.assertIn(self.entry.identify(5, 5), self.IDENTIFY_AS)
self.assertEqual(self.entry.identify(-1, -1), "")

self.assertRaises(tkinter.TclError, self.entry.identify, None, 5)
Expand Down Expand Up @@ -461,7 +461,7 @@ class ComboboxTest(EntryTest, unittest.TestCase):
'validate', 'validatecommand', 'values',
'width', 'xscrollcommand',
)
IDENTIFY_AS = 'Combobox.button' if sys.platform == 'darwin' else 'textarea'
IDENTIFY_AS = {'Combobox.button', 'textarea'}

def setUp(self):
super().setUp()
Expand Down Expand Up @@ -1204,7 +1204,7 @@ class SpinboxTest(EntryTest, unittest.TestCase):
'takefocus', 'textvariable', 'to', 'validate', 'validatecommand',
'values', 'width', 'wrap', 'xscrollcommand',
)
IDENTIFY_AS = 'Spinbox.field' if sys.platform == 'darwin' else 'textarea'
IDENTIFY_AS = {'Spinbox.field', 'textarea'}

def setUp(self):
super().setUp()
Expand Down

0 comments on commit 4ae24de

Please sign in to comment.