]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Fix docstrings quoting. 683/head
authorVladlen Y. Koshelev <vlad.kosh@gmail.com>
Mon, 18 Feb 2013 21:16:54 +0000 (01:16 +0400)
committerVladlen Y. Koshelev <vlad.kosh@gmail.com>
Mon, 18 Feb 2013 21:16:54 +0000 (01:16 +0400)
tornado/stack_context.py
tornado/test/httpserver_test.py
tornado/testing.py

index 2a055d09d95fee096362d99cd24e0afdc69151ed..c30a2598f3cf68b213262dc0f99882be5461042c 100644 (file)
@@ -14,7 +14,7 @@
 # License for the specific language governing permissions and limitations
 # under the License.
 
-'''StackContext allows applications to maintain threadlocal-like state
+"""StackContext allows applications to maintain threadlocal-like state
 that follows execution as it moves to other execution contexts.
 
 The motivating examples are to eliminate the need for explicit
@@ -64,7 +64,7 @@ Here are a few rules of thumb for when it's necessary:
   persist across asynchronous calls, create a new `StackContext` (or
   `ExceptionStackContext`), and make your asynchronous calls in a ``with``
   block that references your `StackContext`.
-'''
+"""
 
 from __future__ import absolute_import, division, print_function, with_statement
 
@@ -88,7 +88,7 @@ _state = _State()
 
 
 class StackContext(object):
-    '''Establishes the given context as a StackContext that will be transferred.
+    """Establishes the given context as a StackContext that will be transferred.
 
     Note that the parameter is a callable that returns a context
     manager, not the context itself.  That is, where for a
@@ -106,7 +106,7 @@ class StackContext(object):
     deactivating a context does not affect any instances of that
     context that are currently pending).  This is an advanced feature
     and not necessary in most applications.
-    '''
+    """
     def __init__(self, context_factory, _active_cell=None):
         self.context_factory = context_factory
         self.active_cell = _active_cell or [True]
@@ -149,7 +149,7 @@ class StackContext(object):
 
 
 class ExceptionStackContext(object):
-    '''Specialization of StackContext for exception handling.
+    """Specialization of StackContext for exception handling.
 
     The supplied exception_handler function will be called in the
     event of an uncaught exception in this context.  The semantics are
@@ -160,7 +160,7 @@ class ExceptionStackContext(object):
 
     If the exception handler returns true, the exception will be
     consumed and will not be propagated to other exception handlers.
-    '''
+    """
     def __init__(self, exception_handler, _active_cell=None):
         self.exception_handler = exception_handler
         self.active_cell = _active_cell or [True]
@@ -188,12 +188,12 @@ class ExceptionStackContext(object):
 
 
 class NullContext(object):
-    '''Resets the StackContext.
+    """Resets the StackContext.
 
     Useful when creating a shared resource on demand (e.g. an AsyncHTTPClient)
     where the stack that caused the creating is not relevant to future
     operations.
-    '''
+    """
     def __enter__(self):
         self.old_contexts = _state.contexts
         _state.contexts = ()
@@ -207,13 +207,13 @@ class _StackContextWrapper(functools.partial):
 
 
 def wrap(fn):
-    '''Returns a callable object that will restore the current StackContext
+    """Returns a callable object that will restore the current StackContext
     when executed.
 
     Use this whenever saving a callback to be executed later in a
     different execution context (either in a different thread or
     asynchronously in the same thread).
-    '''
+    """
     if fn is None or fn.__class__ is _StackContextWrapper:
         return fn
     # functools.wraps doesn't appear to work on functools.partial objects
index 2a60e9de1871f0b4e0b737a65825d8d9282efaca..b3a771c36b00d8dca93f027ecc98c1aa59fa5ca6 100644 (file)
@@ -132,7 +132,7 @@ class BadSSLOptionsTest(unittest.TestCase):
         })
 
     def test_missing_key(self):
-        '''A missing SSL key should cause an immediate exception.'''
+        """A missing SSL key should cause an immediate exception."""
 
         application = Application()
         module_dir = os.path.dirname(__file__)
index ff373970cf114e3d0e4eb51502fa080222dd6f5e..de6e5b4fb85cda73733d5fdfa6594cb602129012 100644 (file)
@@ -167,10 +167,10 @@ class AsyncTestCase(unittest.TestCase):
         super(AsyncTestCase, self).tearDown()
 
     def get_new_ioloop(self):
-        '''Creates a new IOLoop for this test.  May be overridden in
+        """Creates a new IOLoop for this test.  May be overridden in
         subclasses for tests that require a specific IOLoop (usually
         the singleton).
-        '''
+        """
         return IOLoop()
 
     def _handle_exception(self, typ, value, tb):
@@ -192,12 +192,12 @@ class AsyncTestCase(unittest.TestCase):
         self.__rethrow()
 
     def stop(self, _arg=None, **kwargs):
-        '''Stops the ioloop, causing one pending (or future) call to wait()
+        """Stops the ioloop, causing one pending (or future) call to wait()
         to return.
 
         Keyword arguments or a single positional argument passed to stop() are
         saved and will be returned by wait().
-        '''
+        """
         assert _arg is None or not kwargs
         self.__stop_args = kwargs or _arg
         if self.__running:
@@ -241,7 +241,7 @@ class AsyncTestCase(unittest.TestCase):
 
 
 class AsyncHTTPTestCase(AsyncTestCase):
-    '''A test case that starts up an HTTP server.
+    """A test case that starts up an HTTP server.
 
     Subclasses must override get_app(), which returns the
     tornado.web.Application (or other HTTPServer callback) to be tested.
@@ -262,7 +262,7 @@ class AsyncHTTPTestCase(AsyncTestCase):
                 self.http_client.fetch(self.get_url('/'), self.stop)
                 response = self.wait()
                 # test contents of response
-    '''
+    """
     def setUp(self):
         super(AsyncHTTPTestCase, self).setUp()
         sock, port = bind_unused_port()