Coverage for idle_test/test_autocomplete_w.py: 61%

22 statements  

« prev     ^ index     » next       coverage.py v7.2.5, created at 2023-05-11 13:22 -0700

1"Test autocomplete_w, coverage 11%." 

2 

3import unittest 

4from test.support import requires 

5from tkinter import Tk, Text 

6 

7import idlelib.autocomplete_w as acw 

8 

9 

10class AutoCompleteWindowTest(unittest.TestCase): 

11 

12 @classmethod 

13 def setUpClass(cls): 

14 requires('gui') 

15 cls.root = Tk() 

16 cls.root.withdraw() 

17 cls.text = Text(cls.root) 

18 cls.acw = acw.AutoCompleteWindow(cls.text, tags=None) 

19 

20 @classmethod 

21 def tearDownClass(cls): 

22 del cls.text, cls.acw 

23 cls.root.update_idletasks() 

24 cls.root.destroy() 

25 del cls.root 

26 

27 def test_init(self): 

28 self.assertEqual(self.acw.widget, self.text) 

29 

30 

31if __name__ == '__main__': 31 ↛ 32line 31 didn't jump to line 32, because the condition on line 31 was never true

32 unittest.main(verbosity=2)