Issue #19602: Use specific asserts in tkinter tests.

This commit is contained in:
Serhiy Storchaka 2013-11-17 00:42:25 +02:00
parent 78ee078405
commit e3b5a76540
3 changed files with 26 additions and 26 deletions

View file

@ -18,7 +18,7 @@ class StyleTest(unittest.TestCase):
style.configure('TButton', background='yellow')
self.assertEqual(style.configure('TButton', 'background'),
'yellow')
self.assertTrue(isinstance(style.configure('TButton'), dict))
self.assertIsInstance(style.configure('TButton'), dict)
def test_map(self):
@ -26,7 +26,7 @@ class StyleTest(unittest.TestCase):
style.map('TButton', background=[('active', 'background', 'blue')])
self.assertEqual(style.map('TButton', 'background'),
[('active', 'background', 'blue')])
self.assertTrue(isinstance(style.map('TButton'), dict))
self.assertIsInstance(style.map('TButton'), dict)
def test_lookup(self):
@ -57,7 +57,7 @@ class StyleTest(unittest.TestCase):
self.assertEqual(style.layout('Treeview'), tv_style)
# should return a list
self.assertTrue(isinstance(style.layout('TButton'), list))
self.assertIsInstance(style.layout('TButton'), list)
# correct layout, but "option" doesn't exist as option
self.assertRaises(tkinter.TclError, style.layout, 'Treeview',