# HG changeset patch # Parent cf6e782a7f94bb12645b9c704afabbc55ad13803 diff -r cf6e782a7f94 Lib/test/test_contextlib.py --- a/Lib/test/test_contextlib.py Sun May 31 20:21:00 2015 +0300 +++ b/Lib/test/test_contextlib.py Sun May 31 23:41:31 2015 +0000 @@ -106,6 +106,14 @@ baz = self._create_contextmanager_attribs() self.assertEqual(baz.__doc__, "Whee!") + def test_keywords(self): + # Ensure no keyword arguments are inhibited + @contextmanager + def woohoo(self, func, args, kwds): + yield (self, func, args, kwds) + with woohoo(self=11, func=22, args=33, kwds=44) as target: + self.assertEqual(target, (11, 22, 33, 44)) + class NestedTestCase(unittest.TestCase): # XXX This needs more work