Issue #27312: Fix TypeError in test_setupapp

This commit is contained in:
Berker Peksag 2016-06-18 04:18:24 +03:00
parent fdb6ef774a
commit 75a25867ab
1 changed files with 4 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class SetupTest(unittest.TestCase):
del cls.root del cls.root
@mock.patch('idlelib.macosx.overrideRootMenu') #27312 @mock.patch('idlelib.macosx.overrideRootMenu') #27312
def test_setupapp(self): def test_setupapp(self, overrideRootMenu):
"Call setupApp with each possible graphics type." "Call setupApp with each possible graphics type."
root = self.root root = self.root
flist = FileList(root) flist = FileList(root)
@ -92,6 +92,9 @@ class SetupTest(unittest.TestCase):
with self.subTest(tktype=tktype): with self.subTest(tktype=tktype):
macosx._tk_type = tktype macosx._tk_type = tktype
macosx.setupApp(root, flist) macosx.setupApp(root, flist)
if tktype in ('carbon', 'cocoa'):
self.assertTrue(overrideRootMenu.called)
overrideRootMenu.reset_mock()
if __name__ == '__main__': if __name__ == '__main__':