1 "Test , coverage 16%." 2 3 from idlelib import iomenu 4 import unittest 5 from test.support import requires 6 from tkinter import Tk 7 8 from idlelib.editor import EditorWindow 9 10 11 class IOBindigTest(unittest.TestCase): 12 13 @classmethod 14 def setUpClass(cls): 15 requires('gui') 16 cls.root = Tk() 17 cls.root.withdraw() 18 cls.editwin = EditorWindow(root=cls.root) 19 20 @classmethod 21 def tearDownClass(cls): 22 cls.editwin._close() 23 del cls.editwin 24 cls.root.update_idletasks() 25 for id in cls.root.tk.call('after', 'info'): 26 cls.root.after_cancel(id) # Need for EditorWindow. 27 cls.root.destroy() 28 del cls.root 29 30 def test_init(self): 31 io = iomenu.IOBinding(self.editwin) 32 self.assertIs(io.editwin, self.editwin) 33 io.close 34 35 36 if __name__ == '__main__': 37 unittest.main(verbosity=2) 38