This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: Add idlelib.config.IdleConf unittest
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: louielu, terry.reedy, vstinner
Priority: normal Keywords:

Created on 2017-07-13 06:40 by louielu, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 2691 merged louielu, 2017-07-13 06:43
PR 2753 merged terry.reedy, 2017-07-18 21:20
PR 2754 merged louielu, 2017-07-19 01:11
PR 2769 terry.reedy, 2017-07-20 05:05
Messages (12)
msg298266 - (view) Author: Louie Lu (louielu) * Date: 2017-07-13 06:40
Add idlelib.config.IdleConf unittest.
msg298267 - (view) Author: Louie Lu (louielu) * Date: 2017-07-13 06:43
After this unittest is merged, I would like to first cleanup config.py source code, then modify it more general way.
msg298385 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-15 05:46
Yes, go ahead next with name changes and use of modern features such as sets and comprehensions.  Please discuss 'general changes before coding.  When we added Linux Modern keys a year ago, I combined two functions into IdleConf.current_colors_and_keys.  I suspect that there are other duplications to remove.  

Except for extensions, current values in default configs should not change, as doing so will break past versions.  So using them in tests is good, as it will detect unwanted changes to those files.  I hope the list of extensions goes down, but when it does, we can change the tests.
msg298576 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-18 05:39
Whatever is merged with PR_2691, further improvements can be made in further PRs either on this issue or others that work on config code.  

I still think this test is slower than it should be -- the change to deep copy either made no difference or made it slower, but I will try profiling before experimenting more.

In config, the warning prints in the directory search should use _warn, which can be blocked and mocked while testing.

4% uncovered in the file is probably 6% of IdleConf.  At least some is error branches that might be interesting to trigger.
msg298616 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-18 21:17
New changeset f776eb0f0e046f2fa3a96540bb42d8cf970f6c55 by terryjreedy (Louie Lu) in branch 'master':
bpo-30917: IDLE: Add config.IdleConf unittests (#2691)
https://github.com/python/cpython/commit/f776eb0f0e046f2fa3a96540bb42d8cf970f6c55
msg298618 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-18 23:05
The deepcopy does not work on 3.6.  Any fix should be applied to 3.7 as well.  If nothing else, we should try to reload with read_string.

This is a blocker for merging anything else into config and test_config.
msg298625 - (view) Author: Louie Lu (louielu) * Date: 2017-07-19 01:12
PR 2754 changed it to use `read_string`.
msg298638 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-19 05:44
Thanks.  I will look at it tomorrow and if it seems ok, prepare a new combined backport and see if it passes.
msg298669 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2017-07-19 11:29
Please see bpo-30968: "test_get_font (idlelib.idle_test.test_config.IdleConfTest) failure on x86 Windows7 3.x".
msg298694 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-19 23:27
New changeset ed014f7e135fe021837208960237d6c37afde5be by terryjreedy (Louie Lu) in branch 'master':
bpo-30917: IDLE: Fix mock_config deepcopy to read_string (#2754)
https://github.com/python/cpython/commit/ed014f7e135fe021837208960237d6c37afde5be
msg298707 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-20 05:23
New changeset 65c24c846797b93d7adb72fc400f95a570f43fa9 by terryjreedy in branch '3.6':
[3.6] bpo-30917: IDLE: Add config.IdleConf unittests (GH-2691) (#2753)
https://github.com/python/cpython/commit/65c24c846797b93d7adb72fc400f95a570f43fa9
msg298749 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-07-20 20:44
PR2769 is the fix for master for test_get_font for #30968.  The listing here is a cross-reference.  The fix was incorporated into the 3.6 backport PR2753 before it was merged.

This issue is closed, having increased coverage from 46% to 96%.  Further work on config and test config should be new issues building on top of this one.
History
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75100
2017-07-20 20:44:32terry.reedysetstatus: open -> closed
resolution: fixed
messages: + msg298749

stage: patch review -> resolved
2017-07-20 05:23:02terry.reedysetmessages: + msg298707
2017-07-20 05:05:22terry.reedysetpull_requests: + pull_request2828
2017-07-19 23:27:08terry.reedysetmessages: + msg298694
2017-07-19 11:29:43vstinnersetnosy: + vstinner
messages: + msg298669
2017-07-19 05:44:29terry.reedysetmessages: + msg298638
2017-07-19 01:12:11louielusetmessages: + msg298625
2017-07-19 01:11:44louielusetpull_requests: + pull_request2813
2017-07-18 23:05:24terry.reedysetmessages: + msg298618
2017-07-18 21:20:36terry.reedysetpull_requests: + pull_request2812
2017-07-18 21:17:58terry.reedysetmessages: + msg298616
2017-07-18 05:39:29terry.reedysetmessages: + msg298576
2017-07-15 05:46:31terry.reedysettype: enhancement
messages: + msg298385
stage: patch review
2017-07-13 06:43:54louielusetmessages: + msg298267
2017-07-13 06:43:12louielusetpull_requests: + pull_request2755
2017-07-13 06:40:58louielucreate