classification
Title: IDLE autocomplete: refactor and polish code and tests
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2019-03-24 23:11 by terry.reedy, last changed 2019-08-05 01:09 by terry.reedy. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15121 merged terry.reedy, 2019-08-04 21:43
PR 15123 merged miss-islington, 2019-08-04 23:49
PR 15124 merged miss-islington, 2019-08-04 23:49
Messages (5)
msg338766 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-03-24 23:11
Followup to #30348.
1. Merge try_open_completions_event and _open_completions_later.  The latter is only used in the former.  Adjust tests to match.

2. The following in test_open_completions tests >>> "something<tab>
    self.text.insert('1.0', '"t')
    self.assertTrue(self.autocomplete.open_completions(False, True, True))
This passes with unittest (py -m test.test_idle) but fails with regrtest (py -m test -ugui test_idle), with "None is not true".  There are multiple 'return None's in open_completions.  Determine which with debug prints and try to pass with regrtest.  Success does not depend on the inserted text matching any file in the current working directory.

3. Increase coverage.  Multiple conditionals are only triggered 1 way.
msg349008 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-08-04 23:49
New changeset 1213123005d9f94bb5027c0a5256ea4d3e97b61d by Terry Jan Reedy in branch 'master':
bpo-36419: IDLE - Refactor autocompete and improve testing. (#15121)
https://github.com/python/cpython/commit/1213123005d9f94bb5027c0a5256ea4d3e97b61d
msg349009 - (view) Author: miss-islington (miss-islington) Date: 2019-08-05 00:08
New changeset 5349f8cd784220fc6599830c56d3f0614de2b8cb by Miss Islington (bot) in branch '3.8':
bpo-36419: IDLE - Refactor autocompete and improve testing. (GH-15121)
https://github.com/python/cpython/commit/5349f8cd784220fc6599830c56d3f0614de2b8cb
msg349010 - (view) Author: miss-islington (miss-islington) Date: 2019-08-05 00:09
New changeset 4969192f99046bc0f6453185082c00f7a6e132ec by Miss Islington (bot) in branch '3.7':
bpo-36419: IDLE - Refactor autocompete and improve testing. (GH-15121)
https://github.com/python/cpython/commit/4969192f99046bc0f6453185082c00f7a6e132ec
msg349015 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-08-05 01:09
All three goals done.  Most or all of the 7% not covered is the part of the file I did not touch.
History
Date User Action Args
2019-08-05 01:09:57terry.reedysetstatus: open -> closed
versions: + Python 3.9
messages: + msg349015

resolution: fixed
stage: patch review -> resolved
2019-08-05 00:09:40miss-islingtonsetmessages: + msg349010
2019-08-05 00:08:19miss-islingtonsetnosy: + miss-islington
messages: + msg349009
2019-08-04 23:49:14miss-islingtonsetpull_requests: + pull_request14864
2019-08-04 23:49:07miss-islingtonsetpull_requests: + pull_request14863
2019-08-04 23:49:01terry.reedysetmessages: + msg349008
2019-08-04 21:43:50terry.reedysetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request14861
2019-03-24 23:11:25terry.reedycreate