mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
#9607: restore keywords.kwlist after testing it.
This commit is contained in:
parent
32a23c36b4
commit
87e984c1ed
1 changed files with 2 additions and 0 deletions
|
@ -29,6 +29,8 @@ class Test_iskeyword(unittest.TestCase):
|
|||
# This is probably an accident of the current implementation, but should be
|
||||
# preserved for backward compatibility.
|
||||
def test_changing_the_kwlist_does_not_affect_iskeyword(self):
|
||||
oldlist = keyword.kwlist
|
||||
self.addCleanup(lambda: setattr(keyword, 'kwlist', oldlist))
|
||||
keyword.kwlist = ['its', 'all', 'eggs', 'beans', 'and', 'a', 'slice']
|
||||
self.assertFalse(keyword.iskeyword('eggs'))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue