(self)
| 76 | del cls.root |
| 77 | |
| 78 | def setUp(self): |
| 79 | self.text.yview(0) |
| 80 | self.text['font'] = 'TkFixedFont' |
| 81 | self.cc = codecontext.CodeContext(self.editor) |
| 82 | |
| 83 | self.highlight_cfg = {"background": '#abcdef', |
| 84 | "foreground": '#123456'} |
| 85 | orig_idleConf_GetHighlight = codecontext.idleConf.GetHighlight |
| 86 | def mock_idleconf_GetHighlight(theme, element): |
| 87 | if element == 'context': |
| 88 | return self.highlight_cfg |
| 89 | return orig_idleConf_GetHighlight(theme, element) |
| 90 | GetHighlight_patcher = unittest.mock.patch.object( |
| 91 | codecontext.idleConf, 'GetHighlight', mock_idleconf_GetHighlight) |
| 92 | GetHighlight_patcher.start() |
| 93 | self.addCleanup(GetHighlight_patcher.stop) |
| 94 | |
| 95 | self.font_override = 'TkFixedFont' |
| 96 | def mock_idleconf_GetFont(root, configType, section): |
| 97 | return self.font_override |
| 98 | GetFont_patcher = unittest.mock.patch.object( |
| 99 | codecontext.idleConf, 'GetFont', mock_idleconf_GetFont) |
| 100 | GetFont_patcher.start() |
| 101 | self.addCleanup(GetFont_patcher.stop) |
| 102 | |
| 103 | def tearDown(self): |
| 104 | if self.cc.context: |
nothing calls this directly
no test coverage detected