Skip to content

Commit

Permalink
gh-86673: Harden test_ttk.test_element_create_image (#123335)
Browse files Browse the repository at this point in the history
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
erlend-aasland and serhiy-storchaka authored Sep 27, 2024
1 parent 2518918 commit 08e1bbe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_ttk/test_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ def test_element_create_image(self):
foreground='blue', background='yellow')
img3 = tkinter.BitmapImage(master=self.root, file=imgfile,
foreground='white', background='black')
style.element_create('Button.button', 'image',
style.element_create('TestButton.button', 'image',
img1, ('pressed', img2), ('active', img3),
border=(2, 4), sticky='we')
self.assertIn('Button.button', style.element_names())
self.assertIn('TestButton.button', style.element_names())

style.layout('Button', [('Button.button', {'sticky': 'news'})])
b = ttk.Button(self.root, style='Button')
style.layout('TestButton', [('TestButton.button', {'sticky': 'news'})])
b = ttk.Button(self.root, style='TestButton')
b.pack(expand=True, fill='both')
self.assertEqual(b.winfo_reqwidth(), 16)
self.assertEqual(b.winfo_reqheight(), 16)
Expand Down

0 comments on commit 08e1bbe

Please sign in to comment.