1"Test runscript, coverage 16%." 2 3from idlelib import runscript 4import unittest 5from test.support import requires 6from tkinter import Tk 7from idlelib.editor import EditorWindow 8 9 10class 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 32if __name__ == '__main__': 33 unittest.main(verbosity=2) 34