Issue18910
Created on 2013-09-03 01:56 by philwebster, last changed 2016-05-16 04:08 by terry.reedy. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| test_textview.patch | philwebster, 2013-09-03 01:56 | review | ||
| test_textview-18910.patch | terry.reedy, 2014-06-05 08:03 | review | ||
| Messages (13) | |||
|---|---|---|---|
| msg196820 - (view) | Author: Phil Webster (philwebster) * | Date: 2013-09-03 01:56 | |
Started writing the tests for textView.py. |
|||
| msg219782 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-06-05 07:54 | |
New changeset 9ac57970ee4c by Terry Jan Reedy in branch '2.7': Issue #18910: Add unittest for textView. Patch by Phil Webster. http://hg.python.org/cpython/rev/9ac57970ee4c New changeset 99047f3a19a9 by Terry Jan Reedy in branch '3.4': Issue #18910: Add unittest for textView. Patch by Phil Webster. http://hg.python.org/cpython/rev/99047f3a19a9 |
|||
| msg219784 - (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2014-06-05 08:03 | |
The use of .__new__ was cute. Unfortunately, it did not backport to 2.7 because tkinter classes were never upgraded from old to new in 2.7 and old-style classes do not have .__new__. So I monkeypatched the module instead, which is a but clumbsier than patching the instance. Though not every detail is tested, coverage is essentialy 100% and the human text covers the visual details. |
|||
| msg219899 - (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2014-06-06 21:43 | |
Since all tests create a widget with widgets (or destroy it), the new patch moves root to class scope and simplifies the code a bit. It also subclasses TextViewer instead of monkey-patching it. Modules have to be monkey-patched because they cannot be 'sub-moduled'. |
|||
| msg219900 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-06-06 21:44 | |
New changeset 86ba41b7bb46 by Terry Jan Reedy in branch '2.7': Issue #18910: test_textView - since all tests require 'gui', make root global. http://hg.python.org/cpython/rev/86ba41b7bb46 New changeset 5a46ebfa5d90 by Terry Jan Reedy in branch '3.4': Issue #18910: test_textView - since all tests require 'gui', make root global. http://hg.python.org/cpython/rev/5a46ebfa5d90 |
|||
| msg219921 - (view) | Author: Ned Deily (ned.deily) * | Date: 2014-06-07 07:45 | |
It looks like the 2.7 checkin has caused a number of buildbots to fail. Examples: http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%202.7/builds/1094/steps/test/logs/stdio ====================================================================== ERROR: idlelib.idle_test.test_textview (unittest.loader.ModuleImportFailure) ---------------------------------------------------------------------- ImportError: Failed to import test module: idlelib.idle_test.test_textview Traceback (most recent call last): File "/opt/python/2.7.langa-ubuntu/build/Lib/unittest/loader.py", line 254, in _find_tests module = self._get_module_from_name(name) File "/opt/python/2.7.langa-ubuntu/build/Lib/unittest/loader.py", line 232, in _get_module_from_name __import__(name) File "/opt/python/2.7.langa-ubuntu/build/Lib/idlelib/idle_test/test_textview.py", line 11, in <module> requires('gui') File "/opt/python/2.7.langa-ubuntu/build/Lib/test/test_support.py", line 359, in requires raise ResourceDenied(_is_gui_available.reason) ResourceDenied: Tk unavailable due to TclError: no display name and no $DISPLAY environment variab [...] and: http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%202.7/builds/440/steps/test/logs/stdio ====================================================================== ERROR: idlelib.idle_test.test_textview (unittest.loader.ModuleImportFailure) ---------------------------------------------------------------------- ImportError: Failed to import test module: idlelib.idle_test.test_textview Traceback (most recent call last): File "/Users/buildbot/buildarea/2.7.murray-snowleopard/build/Lib/unittest/loader.py", line 254, in _find_tests module = self._get_module_from_name(name) File "/Users/buildbot/buildarea/2.7.murray-snowleopard/build/Lib/unittest/loader.py", line 232, in _get_module_from_name __import__(name) File "/Users/buildbot/buildarea/2.7.murray-snowleopard/build/Lib/idlelib/idle_test/test_textview.py", line 11, in <module> requires('gui') File "/Users/buildbot/buildarea/2.7.murray-snowleopard/build/Lib/test/test_support.py", line 359, in requires raise ResourceDenied(_is_gui_available.reason) ResourceDenied: gui tests cannot run without OS X window manager |
|||
| msg219923 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2014-06-07 08:32 | |
Please don't create Tk object at module creating stage. I afraid this will break unittest discoverity. |
|||
| msg219925 - (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2014-06-07 09:23 | |
The 3.4 stable buildbots are green except for two that ran test_idle ok. The problem is that in 2.7, unittest.loader does not catch ResourceDenied at module level whereas is does in 3.4. The only indication that there should be a difference is that the 3.x doc has "Skipped modules will not have setUpModule() or tearDownModule() run." I am puzzled though, since the manual says this was added in 3.1 and 2.7 came out after. Also, I presume that 2.7 test.regrtest honors the SkipTest raised by 2.7 test_support.import_module, which is usually used at module level. If someone wants to revert the patch, go ahead. I have to get some sleep before I do anything (it is 5 am). -- "Please don't create Tk object at module creating stage." I didn't. I intentionally put TK stuff inside setUpModule so it would happen at test running stage. |
|||
| msg220009 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-06-08 00:57 | |
New changeset a0be81607a50 by Benjamin Peterson in branch '2.7': backed out 86ba41b7bb46 (#18910) for test breakage http://hg.python.org/cpython/rev/a0be81607a50 |
|||
| msg220041 - (view) | Author: Zachary Ware (zach.ware) * | Date: 2014-06-08 18:49 | |
The changeset Benjamin backed out is pretty much fine, just needs the requires('gui') to be at the top of setUpModule instead of at toplevel. That does mean the whole module is constructed and then thrown away without doing anything, but it at least runs properly even with no Tk available.
|
|||
| msg220073 - (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2014-06-09 00:07 | |
Yes, early skipping was the reason I put the test where I did. The simple change occurred to me today. I have not decided yet whether to also change the 3.4/5 files to match and how to edit the testing README. For one test, I would not care either way. But I expect there to be more files with the same issue, So I wonder what is the best way to avoid hitting the same booby trap again. |
|||
| msg265664 - (view) | Author: Roundup Robot (python-dev) | Date: 2016-05-16 03:53 | |
New changeset f5e20abea871 by Terry Jan Reedy in branch '2.7': Issue 18910: Edit idle_test/README.txt to add 'requires' warning. https://hg.python.org/cpython/rev/f5e20abea871 New changeset 735eebce6765 by Terry Jan Reedy in branch '3.5': Issue 18910: Edit idle_test/README.txt to add 'requires' usage at module scope. https://hg.python.org/cpython/rev/735eebce6765 |
|||
| msg265665 - (view) | Author: Terry J. Reedy (terry.reedy) * | Date: 2016-05-16 04:08 | |
I have stopped patching IDLE for 2.7 and will not add more tests. So there is no reason to constrain tests for 3.5, and soon 3.6, to 2.7 limitations. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2016-05-16 04:08:06 | terry.reedy | set | status: open -> closed versions: + Python 3.6 messages: + msg265665 assignee: terry.reedy |
| 2016-05-16 03:53:33 | python-dev | set | messages: + msg265664 |
| 2014-06-09 00:07:59 | terry.reedy | set | messages: + msg220073 |
| 2014-06-08 18:49:52 | zach.ware | set | messages: + msg220041 |
| 2014-06-08 00:57:41 | python-dev | set | messages: + msg220009 |
| 2014-06-07 09:23:14 | terry.reedy | set | messages: + msg219925 |
| 2014-06-07 08:32:43 | serhiy.storchaka | set | nosy:
+ zach.ware |
| 2014-06-07 08:32:05 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg219923 |
| 2014-06-07 07:45:40 | ned.deily | set | status: closed -> open nosy:
+ ned.deily resolution: fixed -> (no value) |
| 2014-06-06 21:44:05 | python-dev | set | messages: + msg219900 |
| 2014-06-06 21:43:15 | terry.reedy | set | nosy:
+ Saimadhav.Heblikar messages: + msg219899 |
| 2014-06-05 08:03:37 | terry.reedy | set | status: open -> closed files: + test_textview-18910.patch messages: + msg219784 resolution: fixed |
| 2014-06-05 07:54:52 | python-dev | set | nosy:
+ python-dev messages: + msg219782 |
| 2014-06-01 22:11:26 | terry.reedy | set | title: IDLE: Unit test for textView.py -> IDle: test textView.py stage: patch review versions: + Python 3.5, - Python 3.3 |
| 2013-09-03 01:56:46 | philwebster | create | |