Coverage for idle_test/test_debugger_r.py: 87%

13 statements  

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

1"Test debugger_r, coverage 30%." 

2 

3from idlelib import debugger_r 

4import unittest 

5 

6# Boilerplate likely to be needed for future test classes. 

7##from test.support import requires 

8##from tkinter import Tk 

9##class Test(unittest.TestCase): 

10## @classmethod 

11## def setUpClass(cls): 

12## requires('gui') 

13## cls.root = Tk() 

14## @classmethod 

15## def tearDownClass(cls): 

16## cls.root.destroy() 

17 

18# GUIProxy, IdbAdapter, FrameProxy, CodeProxy, DictProxy, 

19# GUIAdapter, IdbProxy, and 7 functions still need tests. 

20 

21class IdbAdapterTest(unittest.TestCase): 

22 

23 def test_dict_item_noattr(self): # Issue 33065. 

24 

25 class BinData: 1a

26 def __repr__(self): 1a

27 return self.length 1a

28 

29 debugger_r.dicttable[0] = {'BinData': BinData()} 1a

30 idb = debugger_r.IdbAdapter(None) 1a

31 self.assertTrue(idb.dict_item(0, 'BinData')) 1a

32 debugger_r.dicttable.clear() 1a

33 

34 

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

36 unittest.main(verbosity=2)