◐ Shell
clean mode source ↗

bpo-31002: IDLE: Add tests for configdialog keys tab by csabella · Pull Request #2996 · python/cpython

The tests pass when run normally. But when checking for leaks in the new tests with
python -m test -R: -ugui -v test_idle -m idlelib.idle_test.test_configdialog.KeyTest.*
there are failures in the repetition phase.

test_keybinding (idlelib.idle_test.test_configdialog.KeyTest) ... Exception in Tkinter callback
Traceback (most recent call last):
File "f:\dev\3x\lib\tkinter_init_.py", line 1699, in __call__
return self.func(*args)
File "f:\dev\3x\lib\idlelib\configdialog.py", line 1046, in var_changed_keybinding
ext_name = idleConf.GetExtnNameForEvent(event)
File "f:\dev\3x\lib\idlelib\config.py", line 480, in GetExtnNameForEvent
for event in self.GetExtensionKeys(extn):
File "f:\dev\3x\lib\idlelib\config.py", line 499, in GetExtensionKeys
binding = activeKeys[event]
KeyError: '<>'

FAIL: test_builtin_name (idlelib.idle_test.test_configdialog.KeyTest)
Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\idle_test\test_configdialog.py", line 331, in test_builtin_name
'name2': 'IDLE Modern UNIX'}})
AssertionError: {'Keys': {'name2': 'IDLE Modern UNIX'}} != {'Keys': {'name': 'IDLE Classic Windows', 'name2': 'IDLE Modern UNIX'}}
- {'Keys': {'name2': 'IDLE Modern UNIX'}}
+ {'Keys': {'name': 'IDLE Classic Windows', 'name2': 'IDLE Modern UNIX'}}

FAIL: test_create_new_key_set_and_save_new_key_set (idlelib.idle_test.test_configdialog.KeyTest)
Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\idle_test\test_configdialog.py", line 531, in test_create_new_key_set_and_save_new_key_set
idleConf.GetKeySet(second_new))
AssertionError: {'<>': ['', ''], '<>': [''], '<>': ['']} == {'<>': ['', ''], '<>': [''], '<>': ['']}

FAIL: test_keybinding (idlelib.idle_test.test_configdialog.KeyTest)
Traceback (most recent call last):
File "f:\dev\3x\lib\idlelib\idle_test\test_configdialog.py", line 384, in test_keybinding
{'AutoExpand_cfgBindings': {'expand-word': ''}})
AssertionError: {} != {'AutoExpand_cfgBindings': {'expand-word': ''}}
- {}
+ {'AutoExpand_cfgBindings': {'expand-word': '<Key-F11>'}}

I don't know the details of how the leak test works, but when I made a copy of KeyTest, renamed it KeyTest2, and hit F5, I got the same errors as above plus

FAIL: test_on_bindingslist_select (__main__.KeyTest2)
Traceback (most recent call last):
File "F:\dev\3x\Lib\idlelib\idle_test\test_configdialog.py", line 883, in test_on_bindingslist_select
self.assertEqual(b.get('anchor'), 'find')
AssertionError: '' != 'find'
+ find

These failures indicate bugs in the setup or tear down of the class, all methods, or the individual methods that fail. I will be doing other things until Sunday evening or Monday that will prevent me from much before that.