Skip to content

Commit

Permalink
[3.13] gh-86673: Harden test_ttk.test_element_create_image (GH-123335
Browse files Browse the repository at this point in the history
…) (#124654)

gh-86673: Harden `test_ttk.test_element_create_image` (GH-123335)
(cherry picked from commit 08e1bbe)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
3 people authored Sep 27, 2024
1 parent ac3e6f8 commit caaf939
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 caaf939

Please sign in to comment.