Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-31002: IDLE: Add tests for configdialog keys tab #2996

Merged
merged 5 commits into from
Aug 15, 2017

Conversation

csabella
Copy link
Contributor

@csabella csabella commented Aug 3, 2017

@terryjreedy
Copy link
Member

terryjreedy commented Aug 10, 2017

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.

@terryjreedy
Copy link
Member

I was going to work on this, but now I cannot pull it to make a local branch. Perhaps if you updated it, I could.
f:\dev\3x>git fetch upstream pull/2996/head:pr_2996
From https://github.com/python/cpython
! [rejected] refs/pull/2996/head -> pr_2996 (non-fast-forward)

@csabella
Copy link
Contributor Author

I've rebased and pushed the changes. When I ran the command git fetch upstream pull/2996/head:pr_2996, it created a new branch (pr_2996) the first time I ran it. The second time I ran it, I got the same error as you ! [rejected] refs/pull/2996/head -> pr_2996 (non-fast-forward). If I delete the pr_2996 branch, then I can run the command again.

@terryjreedy
Copy link
Member

Got it now. I asked to delete to branch earlier, as part of starting fresh, but it was not deleted.
I reported that bedevere/news is not working.

Copy link
Member

@terryjreedy terryjreedy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python -m test -R: -ugui -v test_idle -m idlelib.idle_test.test_configdialog.KeyTest.*
no longer gives errors above. Just "test_idle leaked [1, 1, 1, 1] memory blocks, sum=4", which Victor Stinner agrees is a problem in block counting. The leak test passes when test_idle is run without restriction.

There is still self.assertEqual(b.get('anchor'), 'find'): AssertionError: '' != 'find' but this is a problem with event generation, which I already know is tempermental.

@terryjreedy terryjreedy merged commit 2f89646 into python:master Aug 15, 2017
terryjreedy pushed a commit to terryjreedy/cpython that referenced this pull request Aug 15, 2017
…2996)

Patch by Cheryl Sabella.
(cherry picked from commit 2f89646)
terryjreedy added a commit that referenced this pull request Aug 15, 2017
…3092)

Patch by Cheryl Sabella.
(cherry picked from commit 2f89646)
@csabella csabella deleted the bpo31002 branch August 15, 2017 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants