Coverage for idle_test/test_runscript.py: 56%
24 statements
« prev ^ index » next coverage.py v7.2.5, created at 2023-05-11 13:22 -0700
« prev ^ index » next coverage.py v7.2.5, created at 2023-05-11 13:22 -0700
1"Test runscript, coverage 16%."
3from idlelib import runscript
4import unittest
5from test.support import requires
6from tkinter import Tk
7from idlelib.editor import EditorWindow
10class ScriptBindingTest(unittest.TestCase):
12 @classmethod
13 def setUpClass(cls):
14 requires('gui')
15 cls.root = Tk()
16 cls.root.withdraw()
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
26 def test_init(self):
27 ew = EditorWindow(root=self.root)
28 sb = runscript.ScriptBinding(ew)
29 ew._close()
32if __name__ == '__main__': 32 ↛ 33line 32 didn't jump to line 33, because the condition on line 32 was never true
33 unittest.main(verbosity=2)