summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/idle_test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-07-09 22:54:44 (GMT)
committerGitHub <noreply@github.com>2020-07-09 22:54:44 (GMT)
commit3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8 (patch)
tree6cc9ad42f9c7189f3a363ec7ba5070a9e43345c6 /Lib/idlelib/idle_test
parent0b6169e391ce6468aad711f08ffb829362293ad5 (diff)
downloadcpython-3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8.zip
cpython-3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8.tar.gz
cpython-3d1c06e8b9eec5fc1ea2ed4dc1ea79c705da8ab8.tar.bz2
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key. Rewrite Completions doc. Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com> (cherry picked from commit bce2eb4646021910aa4074d86f44a09b32d0b2b2) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r--Lib/idlelib/idle_test/test_autocomplete.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/idlelib/idle_test/test_autocomplete.py b/Lib/idlelib/idle_test/test_autocomplete.py
index 1841495..9c113bd 100644
--- a/Lib/idlelib/idle_test/test_autocomplete.py
+++ b/Lib/idlelib/idle_test/test_autocomplete.py
@@ -240,8 +240,11 @@ class AutoCompleteTest(unittest.TestCase):
with patch.dict('__main__.__dict__', {'__all__': ['a', 'b']}):
s, b = acp.fetch_completions('', ac.ATTRS)
self.assertEqual(s, ['a', 'b'])
- self.assertIn('__name__', b) # From __main__.__dict__
- self.assertIn('sum', b) # From __main__.__builtins__.__dict__
+ self.assertIn('__name__', b) # From __main__.__dict__.
+ self.assertIn('sum', b) # From __main__.__builtins__.__dict__.
+ self.assertIn('nonlocal', b) # From keyword.kwlist.
+ pos = b.index('False') # Test False not included twice.
+ self.assertNotEqual(b[pos+1], 'False')
# Test attributes with name entity.
mock = Mock()