(self)
| 62 | del cls.text, cls.text_frame, cls.editwin, cls.root |
| 63 | |
| 64 | def setUp(self): |
| 65 | self.linenumber = idlelib.sidebar.LineNumbers(self.editwin) |
| 66 | |
| 67 | self.highlight_cfg = {"background": '#abcdef', |
| 68 | "foreground": '#123456'} |
| 69 | orig_idleConf_GetHighlight = idlelib.sidebar.idleConf.GetHighlight |
| 70 | def mock_idleconf_GetHighlight(theme, element): |
| 71 | if element == 'linenumber': |
| 72 | return self.highlight_cfg |
| 73 | return orig_idleConf_GetHighlight(theme, element) |
| 74 | GetHighlight_patcher = unittest.mock.patch.object( |
| 75 | idlelib.sidebar.idleConf, 'GetHighlight', mock_idleconf_GetHighlight) |
| 76 | GetHighlight_patcher.start() |
| 77 | self.addCleanup(GetHighlight_patcher.stop) |
| 78 | |
| 79 | self.font_override = 'TkFixedFont' |
| 80 | def mock_idleconf_GetFont(root, configType, section): |
| 81 | return self.font_override |
| 82 | GetFont_patcher = unittest.mock.patch.object( |
| 83 | idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont) |
| 84 | GetFont_patcher.start() |
| 85 | self.addCleanup(GetFont_patcher.stop) |
| 86 | |
| 87 | def tearDown(self): |
| 88 | self.text.delete('1.0', 'end') |
nothing calls this directly
no test coverage detected