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
Idle: test configHelpSourceEdit #64839
Comments
This patch adds tests for Idle's configHelpSourceEdit.py module. There is however, a minor issue related to this patch,which is an attribute error occurring due to lines 108,115,128,139 on http://hg.python.org/cpython/file/eef7899ea7ab/Lib/idlelib/configHelpSourceEdit.py I have asked the same in irc,where i was advised to post this patch with the issue mentioned. Bear with me,i have tried a lot to overcome this issue,but no avail.Please let me know how to fix this. The test other than this issue,should integrate well. |
The new file is modeled on test_config_name.py, as appropriate. I think this was a good choice for a first test file. The complication you stumbled across is that the config help-source dialog has two entry boxes, whereas the config name dialog only has one. Therefore, the help-source check functions set the focus to the appropriate box when detecting an error, whereas the focus remains on the one box when the name check function detects an error. Problem: the assertEquals on lines 41, 47, 57, and 64 in the test file fail with AttributeErrors attributed to lines 108, 115, 128, and 139 in the module. The failing module lines all look like Reason: The error message is "'dummy_helpsource_dialog' object has no attribute 'entry(Menu/Path)'". This is true: the *dummy class instances* do not have such attributes. Solution: add a mock Entry class to mock_tk with a dummy .focus_set method. Add mock Entry instances to dummy_helpsource_dialog as .entryMenu and .entryPath attributes. Tests now run. See 3.3 patch, which should almost work on 2.7. I still have to review the actual tests, but I anticipate applying this with whatever additional changes I think are needed. Also, when I added test_config_name.py in bpo-18130, rev84040, I found and fixed a buglet in method NameOk(), now name_ok(), and otherwise brought the module code up to PEP-8 standards. I want to check that MenuOk and PathOk do not have a similar buglet, and look at the style also. |
Patch for adding configHelpsourceEdit test for python 3.3.I have hand tested it along with tests and it works well. |
Corresponding patch for 2.7 |
Please redo 3.3 patch for current 3.4 (after htest change). |
New changeset c05689e630d3 by Terry Jan Reedy in branch '3.5': |
The glitch with the section name was that the second time the name was pulled from the StringVar, it was not stripped. The possible fixes were to strip after the second get, get once in ok(), strip, and pass to name_ok, or get once in name_ok, strip, and return to ok(). Both the latter two simplify the code a bit. For help-source, the second gets were alreads stripped as well, so the glitch is not present. I applied the patch as posted. If I were to make a change to get once, I would do it in ok rather than in xyz_ok. Maybe when I combine the files. |
FYI this broke the OS X buildbots: ====================================================================== Traceback (most recent call last):
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/idlelib/idle_test/test_config_help.py", line 96, in test_ok
'https://docs.python.org'))
AssertionError: ['help', 'file://https://docs.python.org'] != ('help', 'https://docs.python.org') ====================================================================== Traceback (most recent call last):
File "/Users/db3l/buildarea/3.5.bolen-tiger/build/Lib/idlelib/idle_test/test_warning.py", line 76, in test_idlever
self.assertEqual(len(w), 1)
AssertionError: 0 != 1 (I’m partly to blame for the current 3.x OS X breakage, but not 3.5.) |
For test_idlever see bpo-25747. |
New changeset ada719145597 by Terry Jan Reedy in branch '3.5': |
Patch should fix test for this issue. Please retest and close if it does. |
Yep all four buildbots, x86 Tiger and AMD64 Snow Leop, 3.5 and 3.x, are now green. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: