mirror of https://github.com/python/cpython
bpo-27313: Use non-deprecated methods for tracing (GH-29425)
This commit is contained in:
parent
57457a1e5c
commit
cc1cbcbb2d
|
@ -307,14 +307,14 @@ class OptionMenuTest(AbstractTkTest, unittest.TestCase):
|
|||
items = ('a', 'b', 'c')
|
||||
textvar = tkinter.StringVar(self.root)
|
||||
def cb_test(*args):
|
||||
self.assertEqual(textvar.get(), items[1])
|
||||
success.append(True)
|
||||
success.append(textvar.get())
|
||||
optmenu = ttk.OptionMenu(self.root, textvar, "a", *items)
|
||||
optmenu.pack()
|
||||
cb_name = textvar.trace("w", cb_test)
|
||||
cb_name = textvar.trace_add("write", cb_test)
|
||||
optmenu['menu'].invoke(1)
|
||||
self.assertEqual(success, [True])
|
||||
textvar.trace_vdelete("w", cb_name)
|
||||
self.assertEqual(success, ['b'])
|
||||
self.assertEqual(textvar.get(), 'b')
|
||||
textvar.trace_remove("write", cb_name)
|
||||
optmenu.destroy()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue