[issue18292] Idle: test AutoExpand.py

2014-06-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2567c68fb300 by Zachary Ware in branch '2.7':
Issue #18292: s/tkinter/Tkinter/
http://hg.python.org/cpython/rev/2567c68fb300

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Whoops. Zach, did you catch that by reading the checkin, running the test, or 
seeing a buildbot problem. Is not the first, what symptom on what system 
revealed the omission?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-05 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
Removed message: http://bugs.python.org/msg219852

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Whoops. Zach, did you catch that by reading the checkin, running the test, or 
seeing a buildbot problem. Is not the first, what symptom on what system 
revealed the omission?

--
nosy: +zach.ware

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-05 Thread Zachary Ware

Zachary Ware added the comment:

Terry J. Reedy added the comment:


 Whoops. Zach, did you catch that by reading the checkin, running the test,
 or seeing a buildbot problem. Is not the first, what symptom on what system
 revealed the omission?


Buildbots; there were several red 2.7 bots and I got curious :).  See
http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%202.7/builds/1091/steps/test/logs/stdio
for example, it basically looked like there was no resource guard.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-04 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com:


Added file: http://bugs.python.org/file35477/test-autoexpand3.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-04 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bdbcd0ae0bde by Terry Jan Reedy in branch '2.7':
Issue #18292: Idle - test AutoExpand. Patch by Saihadhav Heblikar.
http://hg.python.org/cpython/rev/bdbcd0ae0bde

New changeset bbdcf09e3097 by Terry Jan Reedy in branch '3.4':
Issue #18292: Idle - test AutoExpand. Patch by Saihadhav Heblikar.
http://hg.python.org/cpython/rev/bbdcf09e3097

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-04 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Coverage 100%. 2.7 version was easy, so committed after a few minor changes. We 
can revisit using the mock later.

--
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-03 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Attached a patch incorporating changes from msg219661 and 
test-autoexp-18292.diff

I would like to cover those because 
Done

Point 2
Done

self.bell() makes no sound for me. How about you?
No sound for me as well.

Do you see anything like this?
Yes. Reproducing your action prints this message. I had previously seen it(when 
writing htest), it was random. I was unable to reproduce it then.

--
Added file: http://bugs.python.org/file35470/test-autoexpand2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-02 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar saimadhavhebli...@gmail.com:


Added file: http://bugs.python.org/file35458/test-autoexpand1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-02 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Great start. The initial coveraqe is 90%, only missing the 5 lines in getwords 
in the bodies of
if dict.get(w):
continue
,,,
for w in wafter: 
if dict.get(w): 
continue 
words.append(w) 
dict[w] = w 

I would like to cover those because I would like to later replace the dict 
instance dict (bad name!) with a set, 'seen'. 'dict.get(w)' would become 'w in 
seen'; 'dict[w] = w' would become 'seen.add(w)'

Two comments: 1. Using 'previous' to detect the action of 'expand' is really 
clever. 

2. As is typical, you wrote both too much and too little. Too much because some 
of the subtests are redundant, testing the same code paths repeatedly. Every 
subtest should have a reason. Too little because some code paths are skipped.  
To cover with both before and after, with repeats and missed: insert 'aa ab xy 
aa ac\n ad ae xy ae ab\n', Then insert 'a' at the beginning of the second line 
((2,0) as I remember). Words should be ['ac', 'aa', 'ab', 'ad' 'ae' 'a']. 
Expand/previous should produce those in that order. Also do a test with no 
before and some after. You have already done some before and no after.

I uploaded my version. See Rietveld diff for changes. Some notes:

Leave out '-' after 'test-' in file name. Makes coverage call easier.
Todays test.support patch made a line is each file obsolete.
Must keep reference to root to destroy it properly.
I added conditionals so we can easily switch between gui and mock.
These should be added to previous tests that run both ways.
test_get_words had a bug; assertCountEqual instead of assertEqual.

getprevword only sees ascii chars when finding the word prefix. On the other 
hand, for 3.x, \w in getwords matches unicode chars for suffixes. If possible, 
getprevword should use \w to determine the prefix. Then 2.7 and 3.x should work 
on ascii and unicode respectively, with the same code. In a second stage, we 
should fix this and add tests with non-ascii chars (using \u in literals).


self.bell() makes no sound for me. How about you?

A different non-critical nuisance. I start Idle in the debug interpreter with 
'import idlelib.idle'. When root is destroyed, then the following is printed in 
the console interpreter after unittest is done.

can't invoke event command: application has been destroyed
while executing
event generate $w ThemeChanged
(procedure ttk::ThemeChanged line 6)
invoked from within
ttk::ThemeChanged

I determined the timing by changing to 'exit=False' in unittest.main and adding 
'time.sleep(2); print('done') after the u.main() call. Do you see anything like 
this? (Deleting the class attributes does not fix this.) tkinter.ttk in not in 
sys.modules, but perhaps something in one of the other modules directly 
accesses ttk at the tcl level when shutting down.

--
Added file: http://bugs.python.org/file35464/test-autoexp-18292.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-01 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
stage:  - patch review
title: IDLE Improvements: Unit test for AutoExpand.py - Idle: test 
AutoExpand.py
versions: +Python 3.5 -Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18292] Idle: test AutoExpand.py

2014-06-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

For tests that use a Text widget, I want the first version to be a gui test 
using tkinter.Text. This removes mock Text as an issue in writing the tests. I 
will not commit without running the test 'live' at least once.

Once the file (or at least a TestCase) is complete, we can then consider 
replacing the real Text with the mock. The gui code is commented out, rather 
than deleted, in case there is ever a need to switch back. See 
test_searchengine.py (#18489), where this was done,  (Even partial conversions 
are worthwhile if complete conversion is not possible.) Did I forget to say 
this in idle_test/README.txt? (I know I forget to mention this directly before 
now, Sorry ;-).

Some modules import tkinter and instantiate widgets either upon import or 
during testing, (This is different from taking a widget instance as an argument 
in .__init__.) If so  a gui-free test requires that the module be 
monkey-patched with mocks. For SearchEngine, the only widgets are XyzVars and 
TkMessageBox, for which we do have mocks. AutoExpand does not import tkinter, 
so it is fine as is.

In your patch, comment out from idlelib.idle_test.mock_tk import Text and add 
the needed gui code. See the commented out code in 
test_searchengine.

--
stage: patch review - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18292
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com