Skip to content

Commit 6d8e62b

Browse files
Apply review comments
Name the loop variable after what it holds in test_save_all_saves_files, say what RMenuTest covers, and give Dummy_grep the simplifications it makes and a comment for each class variable. Dummy_grep keeps engine and close, which grep_it calls. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent b9170ba commit 6d8e62b

3 files changed

Lines changed: 16 additions & 9 deletions

File tree

Lib/idlelib/idle_test/test_config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,8 +774,8 @@ def test_save_default(self): # Cover 2nd and 3rd false branches.
774774
def test_save_all_saves_files(self):
775775
eq = self.assertEqual
776776
changes = self.changes
777-
for parser in testcfg.values():
778-
parser.Save = Func()
777+
for config in testcfg.values():
778+
config.Save = Func()
779779
try:
780780
# 'main', 'highlight' and 'keys' are saved even if unchanged.
781781
self.assertFalse(changes.save_all())
@@ -787,8 +787,8 @@ def test_save_all_saves_files(self):
787787
self.assertTrue(changes.save_all())
788788
eq(testcfg['extensions'].Save.called, 1)
789789
finally:
790-
for parser in testcfg.values():
791-
del parser.Save
790+
for config in testcfg.values():
791+
del config.Save
792792
userextn.remove_section('Esec')
793793

794794
def test_delete_section(self):

Lib/idlelib/idle_test/test_editor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ def test_searcher(self):
212212

213213

214214
class RMenuTest(unittest.TestCase):
215+
# Test selection-rclick interaction in right_click_event and
216+
# rmenu_check_copy(cut) status settings. These are part of the rmenu
217+
# functions common to all text windows with context windows.
215218

216219
@classmethod
217220
def setUpClass(cls):

Lib/idlelib/idle_test/test_grep.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ def getprog(self):
3131

3232

3333
class Dummy_grep:
34-
# Methods tested
35-
default_command = grep.GrepDialog.default_command
34+
# Simplifications: 1. Don't initialize superclass SearchEngineBase
35+
# with searchengine. 2. Use directly set class vars instead of
36+
# instance vars set from the GUI.
37+
globvar = Var('') # File name.
38+
recvar = Var(False) # Recurse down directories?
39+
engine = searchengine # Pattern and flags.
40+
# Methods tested.
3641
grep_it = grep.GrepDialog.grep_it
37-
# Other stuff needed
38-
recvar = Var(False)
39-
engine = searchengine
42+
default_command = grep.GrepDialog.default_command # Uses grep_it.
43+
4044
def close(self): # gui method
4145
pass
4246

0 commit comments

Comments
 (0)