Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba229d9

Browse files
committed
Issue #21682: Replace EditorWindow with mock to eliminate memory leaks.
Patch by Saimadhav Heblikar. (2 head merge)
2 parents 159824e + 38ebdf5 commit ba229d9

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

Lib/idlelib/idle_test/test_autocomplete.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,21 @@
55
import idlelib.AutoComplete as ac
66
import idlelib.AutoCompleteWindow as acw
77
import idlelib.macosxSupport as mac
8-
from idlelib.EditorWindow import EditorWindow
98
from idlelib.idle_test.mock_idle import Func
109
from idlelib.idle_test.mock_tk import Event
1110

1211
class AutoCompleteWindow:
1312
def complete():
1413
return
1514

15+
class DummyEditwin:
16+
def __init__(self, root, text):
17+
self.root = root
18+
self.text = text
19+
self.indentwidth = 8
20+
self.tabwidth = 8
21+
self.context_use_ps1 = True
22+
1623

1724
class AutoCompleteTest(unittest.TestCase):
1825

@@ -21,8 +28,8 @@ def setUpClass(cls):
2128
requires('gui')
2229
cls.root = Tk()
2330
mac.setupApp(cls.root, None)
24-
cls.editor = EditorWindow(root=cls.root)
25-
cls.text = cls.editor.text
31+
cls.text = Text(cls.root)
32+
cls.editor = DummyEditwin(cls.root, cls.text)
2633

2734
@classmethod
2835
def tearDownClass(cls):

0 commit comments

Comments
 (0)