From: Serhiy Storchaka Date: Sun, 28 Jun 2015 14:11:51 +0000 (+0300) Subject: Issue #24336: Backported test for contextmanager. Patch by Martin Panter. X-Git-Tag: v2.7.11rc1~255^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1d4d8ab995b8deaf100cafe609ab55bf5cac46e;p=thirdparty%2FPython%2Fcpython.git Issue #24336: Backported test for contextmanager. Patch by Martin Panter. --- diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py index f28c95eadbc1..301564bfc062 100644 --- a/Lib/test/test_contextlib.py +++ b/Lib/test/test_contextlib.py @@ -106,6 +106,14 @@ class ContextManagerTestCase(unittest.TestCase): 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