Coverage for idle_test/test_zoomheight.py: 53%
28 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 zoomheight, coverage 66%."
2# Some code is system dependent.
4from idlelib import zoomheight
5import unittest
6from test.support import requires
7from tkinter import Tk
8from idlelib.editor import EditorWindow
11class Test(unittest.TestCase):
13 @classmethod
14 def setUpClass(cls):
15 requires('gui')
16 cls.root = Tk()
17 cls.root.withdraw()
18 cls.editwin = EditorWindow(root=cls.root)
20 @classmethod
21 def tearDownClass(cls):
22 cls.editwin._close()
23 cls.root.update_idletasks()
24 for id in cls.root.tk.call('after', 'info'):
25 cls.root.after_cancel(id) # Need for EditorWindow.
26 cls.root.destroy()
27 del cls.root
29 def test_init(self):
30 zoom = zoomheight.ZoomHeight(self.editwin)
31 self.assertIs(zoom.editwin, self.editwin)
33 def test_zoom_height_event(self):
34 zoom = zoomheight.ZoomHeight(self.editwin)
35 zoom.zoom_height_event()
38if __name__ == '__main__': 38 ↛ 39line 38 didn't jump to line 39, because the condition on line 38 was never true
39 unittest.main(verbosity=2)