MCPcopy Index your code
hub / github.com/python/cpython / test_theme_use

Method test_theme_use

Lib/test/test_ttk/test_style.py:107–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

105
106
107 def test_theme_use(self):
108 self.assertRaises(tkinter.TclError, self.style.theme_use,
109 'nonexistingname')
110
111 curr_theme = self.style.theme_use()
112 new_theme = None
113 for theme in self.style.theme_names():
114 if theme != curr_theme:
115 new_theme = theme
116 self.style.theme_use(theme)
117 break
118 else:
119 # just one theme available, can't go on with tests
120 return
121
122 self.assertFalse(curr_theme == new_theme)
123 self.assertFalse(new_theme != self.style.theme_use())
124
125 self.style.theme_use(curr_theme)
126
127 def test_configure_custom_copy(self):
128 style = self.style

Callers

nothing calls this directly

Calls 4

theme_useMethod · 0.80
theme_namesMethod · 0.80
assertFalseMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected