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