mirror of
https://github.com/python/cpython.git
synced 2024-12-24 09:15:04 +08:00
#9607: restore keywords.kwlist after testing it.
This commit is contained in:
parent
32a23c36b4
commit
87e984c1ed
@ -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…
Reference in New Issue
Block a user