Kaydet (Commit) d1d4d8ab authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #24336: Backported test for contextmanager. Patch by Martin Panter.

üst 1c72acf2
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment