#9607: restore keywords.kwlist after testing it.

This commit is contained in:
R David Murray 2013-04-19 22:38:58 -04:00
parent 32a23c36b4
commit 87e984c1ed
1 changed files with 2 additions and 0 deletions

View File

@ -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'))