diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-06-07 08:27:50 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-06-07 08:27:50 (GMT) |
commit | 38ebdf528e63e47c63bab9ba96dcbf98d7d84316 (patch) | |
tree | a84ebc7aaf51fa90293ae7715bf43f5bb6173125 /Lib/idlelib/idle_test | |
parent | 4a3f135c8d623d97782ccaea6bb37b1786f86de0 (diff) | |
download | cpython-38ebdf528e63e47c63bab9ba96dcbf98d7d84316.zip cpython-38ebdf528e63e47c63bab9ba96dcbf98d7d84316.tar.gz cpython-38ebdf528e63e47c63bab9ba96dcbf98d7d84316.tar.bz2 |
Issue #21682: Replace EditorWindow with mock to eliminate memory leaks.
Patch by Saimadhav Heblikar.
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_autocomplete.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py index e4034eb..6a33b45 100644 --- a/Lib/idlelib/idle_test/test_autocomplete.py +++ b/Lib/idlelib/idle_test/test_autocomplete.py @@ -5,7 +5,6 @@ from tkinter import Tk, Text, TclError import idlelib.AutoComplete as ac import idlelib.AutoCompleteWindow as acw import idlelib.macosxSupport as mac -from idlelib.EditorWindow import EditorWindow from idlelib.idle_test.mock_idle import Func from idlelib.idle_test.mock_tk import Event @@ -13,6 +12,14 @@ class AutoCompleteWindow: def complete(): return +class DummyEditwin: + def __init__(self, root, text): + self.root = root + self.text = text + self.indentwidth = 8 + self.tabwidth = 8 + self.context_use_ps1 = True + class AutoCompleteTest(unittest.TestCase): @@ -21,8 +28,8 @@ class AutoCompleteTest(unittest.TestCase): requires('gui') cls.root = Tk() mac.setupApp(cls.root, None) - cls.editor = EditorWindow(root=cls.root) - cls.text = cls.editor.text + cls.text = Text(cls.root) + cls.editor = DummyEditwin(cls.root, cls.text) @classmethod def tearDownClass(cls): |