Skip to content

Commit 4f9e553

Browse files
committed
gh-89520: IDLE - Fix test_exists_user cleanup to properly remove section
read_dict is additive and doesn't remove sections. Setting enable to False still leaves the ZzDummy section in user config. Use remove_section to fully restore the original empty state.
1 parent 392985a commit 4f9e553

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

Lib/idlelib/idle_test/test_zzdummy.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ def test_exists_user(self):
9999
self.assertEqual(zzdummy.idleConf.GetExtensionKeys("ZzDummy"), {'<<z-in>>': ['<Control-Shift-KeyRelease-Insert>']})
100100
self.assertEqual(zzdummy.idleConf.GetExtensionBindings("ZzDummy"), {'<<z-in>>': ['<Control-Shift-KeyRelease-Insert>'], '<<z-out>>': ['<Control-Shift-KeyRelease-Delete>']})
101101
# Restore
102-
zzdummy.idleConf.userCfg["extensions"].read_dict({
103-
"ZzDummy": {'enable': 'False'}
104-
})
102+
zzdummy.idleConf.userCfg["extensions"].remove_section("ZzDummy")
105103

106104
def test_init(self):
107105
zz = self.zz

0 commit comments

Comments
 (0)