Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Lib/test/test_ttk/test_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,17 @@ def test_configure_custom_copy(self):
newname = f'C.{name}'
self.assertEqual(style.configure(newname), None)
style.configure(newname, **default)
self.assertEqual(style.configure(newname), default)
# With Tk 9 and the aqua theme an empty option value is
# read back as an empty tuple rather than an empty string
# (see gh-128846); normalize before comparing.
def norm(value):
return '' if value == () else value

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return '' if value == () else value
return () if value == '' else value

copy = style.configure(newname)
self.assertEqual({k: norm(v) for k, v in copy.items()},
default)
for key, value in default.items():
self.assertEqual(style.configure(newname, key), value)
self.assertEqual(norm(style.configure(newname, key)),
value)


def test_map_custom_copy(self):
Expand Down
Loading