]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Use py26-compatible syntax in tests.
authorBen Darnell <ben@bendarnell.com>
Mon, 27 May 2013 01:54:07 +0000 (21:54 -0400)
committerBen Darnell <ben@bendarnell.com>
Mon, 27 May 2013 01:54:07 +0000 (21:54 -0400)
tornado/test/stack_context_test.py

index 192bf8914ba7200b277e586f78eafde736722b19..a8af08ae86a303d21f4fc16998816bc59c18ffa2 100644 (file)
@@ -149,10 +149,11 @@ class StackContextTest(AsyncTestCase):
             # Remove the test's stack context to make sure we can cover
             # the case where the last context is deactivated.
             with NullContext():
-                with StackContext(functools.partial(self.context, 'c0')) as c0,\
-                     StackContext(functools.partial(self.context, 'c1')) as c1,\
-                     StackContext(functools.partial(self.context, 'c2')) as c2:
-                    return (wrap(check_contexts), [c0, c1, c2])
+                partial = functools.partial
+                with StackContext(partial(self.context, 'c0')) as c0:
+                    with StackContext(partial(self.context, 'c1')) as c1:
+                        with StackContext(partial(self.context, 'c2')) as c2:
+                            return (wrap(check_contexts), [c0, c1, c2])
 
         # First make sure the test mechanism works without any deactivations
         func, deactivate_callbacks = make_wrapped_function()