ploxiln: So, uh, this didn't work out as well as I expected - in branch5.1 websocket_connect() raises HTTPStreamClosedError for these cases, even without the backported fix to websocket.py, so "fixing" the tests for branch5.1 makes them not really distinguish before the fix from after it.

(and the last travis failure was a bunch of flake8 errors which I think are just because a new stable version of flake8 was just released)
bdarnell: > So, uh, this didn't work out as well as I expected - in branch5.1 websocket_connect() raises HTTPStreamClosedError for these cases, even without the backported fix to websocket.py, so "fixing" the tests for branch5.1 makes them not really distinguish before the fix from after it.

That surprises me. The original bug report (#2570) was that the connection would hang and the client would never see the error. Where is the HTTPStreamClosedError coming from if the server isn't catching the error correctly? 

Maybe that `gen.sleep(0)` is not actually forcing an extra IOLoop iteration so it's making the coroutine act like it's synchronous (seems unlikely but maybe I'm forgetting a fast path that differs with the move from `await asyncio.sleep(0)` in 6.0 to `yield gen.sleep(0)` in 5.1)
ploxiln: yeah, I'll investigate a bit and try some more stuff
diff --git a/.flake8 b/.flake8
index 803d06d2..1c2c768d 100644
--- a/.flake8
+++ b/.flake8
@@ -10,6 +10,4 @@ ignore =
     E402,
     # E722 do not use bare except
     E722,
-    # W504 line break after binary operator
-    W504,
 doctests = true
diff --git a/tornado/util.py b/tornado/util.py
index 151b0d88..a42ebebe 100644
--- a/tornado/util.py
+++ b/tornado/util.py
@@ -59,7 +59,7 @@ else:
     import datetime  # noqa
     import types  # noqa
     from typing import Any, AnyStr, Union, Optional, Dict, Mapping  # noqa
-    from typing import List, Tuple, Match, Callable  # noqa
+    from typing import Tuple, Match, Callable  # noqa
 
     if PY3:
         _BaseString = str
@@ -252,7 +252,7 @@ _re_unescape_pattern = re.compile(r'\\(.)', re.DOTALL)
 
 def re_unescape(s):
     # type: (str) -> str
-    r"""Unescape a string escaped by `re.escape`.
+    """Unescape a string escaped by `re.escape`.
 
     May raise ``ValueError`` for regular expressions which could not
     have been produced by `re.escape` (for example, strings containing
diff --git a/tornado/web.py b/tornado/web.py
index 4340b16f..6760b0b9 100644
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -1887,7 +1887,7 @@ class _ApplicationRouter(ReversibleRuleRouter):
 
 
 class Application(ReversibleRouter):
-    r"""A collection of request handlers that make up a web application.
+    """A collection of request handlers that make up a web application.
 
     Instances of this class are callable and can be passed directly to
     HTTPServer to serve the application::
diff --git a/tornado/websocket.py b/tornado/websocket.py
index 0b994fc1..7b77850a 100644
--- a/tornado/websocket.py
+++ b/tornado/websocket.py
@@ -751,10 +751,14 @@ class WebSocketProtocol13(WebSocketProtocol):
         self.stream = self.handler.stream
 
         self.start_pinging()
-        open_result = self._run_callback(self.handler.open, *self.handler.open_args,
-                                         **self.handler.open_kwargs)
-        if open_result is not None:
-            yield open_result
+        try:
+            open_result = self.handler.open(*self.handler.open_args, **self.handler.open_kwargs)
+            if open_result is not None:
+                yield open_result
+        except Exception:
+            self.handler.log_exception(*sys.exc_info())
+            self._abort()
+
         yield self._receive_frame_loop()
 
     def _parse_extensions_header(self, headers):

Unhandled exception in open coroutine of websockethandler does not close connection
I tested the following app with version 5.1.1 of tornado:

```
import tornado
import tornado.websocket
import tornado.ioloop
from tornado import gen


class MySocket(tornado.websocket.WebSocketHandler):
    def open(self):
        print 'socket opened'
        raise Exception('bad')

    @gen.coroutine
    def on_message(self, message):
        print message

    def on_close(self):
        print 'closed'


def create_application():
    return tornado.web.Application([
        (r"^/?$", MySocket),
    ])


application = create_application()
application.listen(8000)
tornado.ioloop.IOLoop.current().start()
```

If I connect with a client, I get the following (correct) output on the server side:

```
socket opened
ERROR:tornado.application:Uncaught exception GET / (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 546, in _run_callback
    result = callback(*args, **kwargs)
  File "./test.py", line 10, in open
    raise Exception('bad')
Exception: bad
closed
```

However, if I add the gen.coroutine annotation to ``open`` and run the same test, I get this output instead:

```
socket opened
ERROR:tornado.application:Exception in callback <functools.partial object at 0x7fea30c31c00>
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/tornado/ioloop.py", line 758, in _run_callback
    ret = callback()
  File "/usr/local/lib/python2.7/site-packages/tornado/stack_context.py", line 300, in null_wrapper
    return fn(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 553, in <lambda>
    self.stream.io_loop.add_future(result, lambda f: f.result())
  File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 261, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 307, in wrapper
    result = func(*args, **kwargs)
  File "./test.py", line 11, in open
    raise Exception('bad')
Exception: bad
ERROR:tornado.application:Future exception was never retrieved: Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/usr/local/lib/python2.7/site-packages/tornado/websocket.py", line 757, in _accept_connection
    yield open_result
  File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/usr/local/lib/python2.7/site-packages/tornado/concurrent.py", line 261, in result
    raise_exc_info(self._exc_info)
  File "/usr/local/lib/python2.7/site-packages/tornado/gen.py", line 307, in wrapper
    result = func(*args, **kwargs)
  File "./test.py", line 11, in open
    raise Exception('bad')
Exception: bad
```

Note that there is no "closed" message. On the client side, the client still thinks the connection is still open and I can send messages without error. Without the coroutine, the client gets a broken pipe error the next time it tries to send a message.
diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py
index b1ae4747..16938c42 100644
--- a/tornado/test/web_test.py
+++ b/tornado/test/web_test.py
@@ -398,7 +398,7 @@ class AuthRedirectTest(WebTestCase):
                               follow_redirects=False)
         self.assertEqual(response.code, 302)
         self.assertTrue(re.match(
-            r'http://example.com/login\?next=http%3A%2F%2F127.0.0.1%3A[0-9]+%2Fabsolute',
+            'http://example.com/login\?next=http%3A%2F%2F127.0.0.1%3A[0-9]+%2Fabsolute',
             response.headers['Location']), response.headers['Location'])
 
 
diff --git a/tornado/test/websocket_test.py b/tornado/test/websocket_test.py
index ea7b1e4c..1d5bfa68 100644
--- a/tornado/test/websocket_test.py
+++ b/tornado/test/websocket_test.py
@@ -181,6 +181,18 @@ class OpenCoroutineHandler(TestWebSocketHandler):
         self.write_message('ok')
 
 
+class ErrorInOpenHandler(TestWebSocketHandler):
+    def open(self):
+        raise Exception("boom")
+
+
+class ErrorInAsyncOpenHandler(TestWebSocketHandler):
+    @gen.coroutine
+    def open(self):
+        yield gen.sleep(0.01)
+        raise Exception("boom")
+
+
 class WebSocketBaseTestCase(AsyncHTTPTestCase):
     @gen.coroutine
     def ws_connect(self, path, **kwargs):
@@ -225,6 +237,10 @@ class WebSocketTest(WebSocketBaseTestCase):
              dict(close_future=self.close_future)),
             ('/open_coroutine', OpenCoroutineHandler,
              dict(close_future=self.close_future, test=self)),
+            ("/error_in_open", ErrorInOpenHandler,
+             dict(close_future=self.close_future)),
+            ("/error_in_async_open", ErrorInAsyncOpenHandler,
+             dict(close_future=self.close_future)),
         ], template_loader=DictLoader({
             'message.html': '<b>{{ message }}</b>',
         }))
@@ -511,6 +527,20 @@ class WebSocketTest(WebSocketBaseTestCase):
         self.assertEqual(res, 'ok')
         yield self.close(ws)
 
+    @gen_test
+    def test_error_in_open(self):
+        with ExpectLog(app_log, "Uncaught exception"):
+            ws = yield self.ws_connect("/error_in_open")
+            res = yield ws.read_message()
+        self.assertIsNone(res)
+
+    @gen_test
+    def test_error_in_async_open(self):
+        with ExpectLog(app_log, "Uncaught exception"):
+            ws = yield self.ws_connect("/error_in_async_open")
+            res = yield ws.read_message()
+        self.assertIsNone(res)
+
 
 if sys.version_info >= (3, 5):
     NativeCoroutineOnMessageHandler = exec_test(globals(), locals(), """

pip install -e .
parse_log_pytest
pytest
pytest
apt-get update apt-get install -y gcc
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
-e git+https://github.com/tornadoweb/tornado.git@97d6599637e683fcab1d391468a8408c8496939a#egg=tornado
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: tornado
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
prefix: /opt/conda/envs/tornado

tornado/test/websocket_test.py::WebSocketTest::test_error_in_async_open
tornado/test/web_test.py::SecureCookieV1Test::test_arbitrary_bytes tornado/test/web_test.py::SecureCookieV1Test::test_cookie_tampering_future_timestamp tornado/test/web_test.py::SecureCookieV1Test::test_round_trip tornado/test/web_test.py::SecureCookieV2Test::test_key_version_increment_version tornado/test/web_test.py::SecureCookieV2Test::test_key_version_invalidate_version tornado/test/web_test.py::SecureCookieV2Test::test_key_version_roundtrip tornado/test/web_test.py::SecureCookieV2Test::test_key_version_roundtrip_differing_version tornado/test/web_test.py::SecureCookieV2Test::test_round_trip tornado/test/web_test.py::FinalReturnTest::test_finish_method_return_future tornado/test/web_test.py::FinalReturnTest::test_render_method_return_future tornado/test/web_test.py::CookieTest::test_cookie_special_char tornado/test/web_test.py::CookieTest::test_get_cookie tornado/test/web_test.py::CookieTest::test_set_cookie tornado/test/web_test.py::CookieTest::test_set_cookie_domain tornado/test/web_test.py::CookieTest::test_set_cookie_expires_days tornado/test/web_test.py::CookieTest::test_set_cookie_false_flags tornado/test/web_test.py::CookieTest::test_set_cookie_max_age tornado/test/web_test.py::CookieTest::test_set_cookie_overwrite tornado/test/web_test.py::AuthRedirectTest::test_absolute_auth_redirect tornado/test/web_test.py::AuthRedirectTest::test_relative_auth_redirect tornado/test/web_test.py::ConnectionCloseTest::test_connection_close tornado/test/web_test.py::RequestEncodingTest::test_error tornado/test/web_test.py::RequestEncodingTest::test_group_encoding tornado/test/web_test.py::RequestEncodingTest::test_group_question_mark tornado/test/web_test.py::RequestEncodingTest::test_slashes tornado/test/web_test.py::WSGISafeWebTest::test_decode_argument tornado/test/web_test.py::WSGISafeWebTest::test_decode_argument_invalid_unicode tornado/test/web_test.py::WSGISafeWebTest::test_decode_argument_plus tornado/test/web_test.py::WSGISafeWebTest::test_get_argument tornado/test/web_test.py::WSGISafeWebTest::test_get_body_arguments tornado/test/web_test.py::WSGISafeWebTest::test_get_query_arguments tornado/test/web_test.py::WSGISafeWebTest::test_header_injection tornado/test/web_test.py::WSGISafeWebTest::test_multi_header tornado/test/web_test.py::WSGISafeWebTest::test_no_gzip tornado/test/web_test.py::WSGISafeWebTest::test_optional_path tornado/test/web_test.py::WSGISafeWebTest::test_redirect tornado/test/web_test.py::WSGISafeWebTest::test_reverse_url tornado/test/web_test.py::WSGISafeWebTest::test_types tornado/test/web_test.py::WSGISafeWebTest::test_uimodule_resources tornado/test/web_test.py::WSGISafeWebTest::test_uimodule_unescaped tornado/test/web_test.py::WSGISafeWebTest::test_web_redirect tornado/test/web_test.py::WSGISafeWebTest::test_web_redirect_double_slash tornado/test/web_test.py::NonWSGIWebTests::test_empty_flush tornado/test/web_test.py::NonWSGIWebTests::test_flow_control tornado/test/web_test.py::ErrorResponseTest::test_default tornado/test/web_test.py::ErrorResponseTest::test_failed_write_error tornado/test/web_test.py::ErrorResponseTest::test_write_error tornado/test/web_test.py::StaticFileTest::test_absolute_static_url tornado/test/web_test.py::StaticFileTest::test_absolute_version_exclusion tornado/test/web_test.py::StaticFileTest::test_include_host_override tornado/test/web_test.py::StaticFileTest::test_path_traversal_protection tornado/test/web_test.py::StaticFileTest::test_relative_version_exclusion tornado/test/web_test.py::StaticFileTest::test_root_static_path tornado/test/web_test.py::StaticFileTest::test_static_304_etag_modified_bug tornado/test/web_test.py::StaticFileTest::test_static_304_if_modified_since tornado/test/web_test.py::StaticFileTest::test_static_304_if_none_match tornado/test/web_test.py::StaticFileTest::test_static_404 tornado/test/web_test.py::StaticFileTest::test_static_compressed_files tornado/test/web_test.py::StaticFileTest::test_static_etag tornado/test/web_test.py::StaticFileTest::test_static_files tornado/test/web_test.py::StaticFileTest::test_static_head tornado/test/web_test.py::StaticFileTest::test_static_head_range tornado/test/web_test.py::StaticFileTest::test_static_if_modified_since_pre_epoch tornado/test/web_test.py::StaticFileTest::test_static_if_modified_since_time_zone tornado/test/web_test.py::StaticFileTest::test_static_invalid_range tornado/test/web_test.py::StaticFileTest::test_static_range_if_none_match tornado/test/web_test.py::StaticFileTest::test_static_unsatisfiable_range_invalid_start tornado/test/web_test.py::StaticFileTest::test_static_unsatisfiable_range_zero_suffix tornado/test/web_test.py::StaticFileTest::test_static_url tornado/test/web_test.py::StaticFileTest::test_static_with_range tornado/test/web_test.py::StaticFileTest::test_static_with_range_end_edge tornado/test/web_test.py::StaticFileTest::test_static_with_range_full_file tornado/test/web_test.py::StaticFileTest::test_static_with_range_full_past_end tornado/test/web_test.py::StaticFileTest::test_static_with_range_neg_end tornado/test/web_test.py::StaticFileTest::test_static_with_range_partial_past_end tornado/test/web_test.py::StaticDefaultFilenameTest::test_static_default_filename tornado/test/web_test.py::StaticDefaultFilenameTest::test_static_default_redirect tornado/test/web_test.py::StaticFileWithPathTest::test_serve tornado/test/web_test.py::CustomStaticFileTest::test_serve tornado/test/web_test.py::CustomStaticFileTest::test_static_url tornado/test/web_test.py::HostMatchingTest::test_host_matching tornado/test/web_test.py::DefaultHostMatchingTest::test_default_host_matching tornado/test/web_test.py::NamedURLSpecGroupsTest::test_named_urlspec_groups tornado/test/web_test.py::ClearHeaderTest::test_clear_header tornado/test/web_test.py::Header204Test::test_204_headers tornado/test/web_test.py::Header304Test::test_304_headers tornado/test/web_test.py::StatusReasonTest::test_status tornado/test/web_test.py::DateHeaderTest::test_date_header tornado/test/web_test.py::RaiseWithReasonTest::test_httperror_str tornado/test/web_test.py::RaiseWithReasonTest::test_httperror_str_from_httputil tornado/test/web_test.py::RaiseWithReasonTest::test_raise_with_reason tornado/test/web_test.py::ErrorHandlerXSRFTest::test_404_xsrf tornado/test/web_test.py::ErrorHandlerXSRFTest::test_error_xsrf tornado/test/web_test.py::GzipTestCase::test_gzip tornado/test/web_test.py::GzipTestCase::test_gzip_not_requested tornado/test/web_test.py::GzipTestCase::test_gzip_static tornado/test/web_test.py::GzipTestCase::test_vary_already_present tornado/test/web_test.py::GzipTestCase::test_vary_already_present_multiple tornado/test/web_test.py::PathArgsInPrepareTest::test_kw tornado/test/web_test.py::PathArgsInPrepareTest::test_pos tornado/test/web_test.py::ClearAllCookiesTest::test_clear_all_cookies tornado/test/web_test.py::ExceptionHandlerTest::test_http_error tornado/test/web_test.py::ExceptionHandlerTest::test_known_error tornado/test/web_test.py::ExceptionHandlerTest::test_unknown_error tornado/test/web_test.py::BuggyLoggingTest::test_buggy_log_exception tornado/test/web_test.py::UIMethodUIModuleTest::test_ui_method tornado/test/web_test.py::GetArgumentErrorTest::test_catch_error tornado/test/web_test.py::MultipleExceptionTest::test_multi_exception tornado/test/web_test.py::SetLazyPropertiesTest::test_set_properties tornado/test/web_test.py::GetCurrentUserTest::test_get_current_user_from_ui_module_is_lazy tornado/test/web_test.py::GetCurrentUserTest::test_get_current_user_from_ui_module_works tornado/test/web_test.py::GetCurrentUserTest::test_get_current_user_works tornado/test/web_test.py::UnimplementedHTTPMethodsTest::test_unimplemented_standard_methods tornado/test/web_test.py::UnimplementedNonStandardMethodsTest::test_unimplemented_other tornado/test/web_test.py::UnimplementedNonStandardMethodsTest::test_unimplemented_patch tornado/test/web_test.py::AllHTTPMethodsTest::test_standard_methods tornado/test/web_test.py::PatchMethodTest::test_other tornado/test/web_test.py::PatchMethodTest::test_patch tornado/test/web_test.py::FinishInPrepareTest::test_finish_in_prepare tornado/test/web_test.py::Default404Test::test_404 tornado/test/web_test.py::Custom404Test::test_404 tornado/test/web_test.py::DefaultHandlerArgumentsTest::test_403 tornado/test/web_test.py::HandlerByNameTest::test_handler_by_name tornado/test/web_test.py::StreamingRequestBodyTest::test_close_during_upload tornado/test/web_test.py::StreamingRequestBodyTest::test_early_return tornado/test/web_test.py::StreamingRequestBodyTest::test_early_return_with_data tornado/test/web_test.py::StreamingRequestBodyTest::test_streaming_body tornado/test/web_test.py::DecoratedStreamingRequestFlowControlTest::test_flow_control_chunked_body tornado/test/web_test.py::DecoratedStreamingRequestFlowControlTest::test_flow_control_compressed_body tornado/test/web_test.py::DecoratedStreamingRequestFlowControlTest::test_flow_control_fixed_body tornado/test/web_test.py::NativeStreamingRequestFlowControlTest::test_flow_control_chunked_body tornado/test/web_test.py::NativeStreamingRequestFlowControlTest::test_flow_control_compressed_body tornado/test/web_test.py::NativeStreamingRequestFlowControlTest::test_flow_control_fixed_body tornado/test/web_test.py::IncorrectContentLengthTest::test_content_length_too_high tornado/test/web_test.py::IncorrectContentLengthTest::test_content_length_too_low tornado/test/web_test.py::ClientCloseTest::test_client_close tornado/test/web_test.py::SignedValueTest::test_expired tornado/test/web_test.py::SignedValueTest::test_key_version_retrieval tornado/test/web_test.py::SignedValueTest::test_key_versioning_invalid_key tornado/test/web_test.py::SignedValueTest::test_key_versioning_read_write_default_key tornado/test/web_test.py::SignedValueTest::test_key_versioning_read_write_non_default_key tornado/test/web_test.py::SignedValueTest::test_known_values tornado/test/web_test.py::SignedValueTest::test_name_swap tornado/test/web_test.py::SignedValueTest::test_non_ascii tornado/test/web_test.py::SignedValueTest::test_payload_tampering tornado/test/web_test.py::SignedValueTest::test_signature_tampering tornado/test/web_test.py::XSRFTest::test_cross_user tornado/test/web_test.py::XSRFTest::test_distinct_tokens tornado/test/web_test.py::XSRFTest::test_refresh_token tornado/test/web_test.py::XSRFTest::test_versioning tornado/test/web_test.py::XSRFTest::test_xsrf_fail_argument_invalid_format tornado/test/web_test.py::XSRFTest::test_xsrf_fail_body_no_cookie tornado/test/web_test.py::XSRFTest::test_xsrf_fail_cookie_invalid_format tornado/test/web_test.py::XSRFTest::test_xsrf_fail_cookie_no_body tornado/test/web_test.py::XSRFTest::test_xsrf_fail_no_token tornado/test/web_test.py::XSRFTest::test_xsrf_success_header tornado/test/web_test.py::XSRFTest::test_xsrf_success_non_hex_token tornado/test/web_test.py::XSRFTest::test_xsrf_success_post_body tornado/test/web_test.py::XSRFTest::test_xsrf_success_query_string tornado/test/web_test.py::XSRFTest::test_xsrf_success_short_token tornado/test/web_test.py::XSRFCookieKwargsTest::test_xsrf_httponly tornado/test/web_test.py::FinishExceptionTest::test_finish_exception tornado/test/web_test.py::DecoratorTest::test_addslash tornado/test/web_test.py::DecoratorTest::test_removeslash tornado/test/web_test.py::CacheTest::test_multiple_strong_etag_match tornado/test/web_test.py::CacheTest::test_multiple_strong_etag_not_match tornado/test/web_test.py::CacheTest::test_multiple_weak_etag_match tornado/test/web_test.py::CacheTest::test_multiple_weak_etag_not_match tornado/test/web_test.py::CacheTest::test_strong_etag_match tornado/test/web_test.py::CacheTest::test_strong_etag_not_match tornado/test/web_test.py::CacheTest::test_weak_etag_match tornado/test/web_test.py::CacheTest::test_weak_etag_not_match tornado/test/web_test.py::CacheTest::test_wildcard_etag tornado/test/web_test.py::RequestSummaryTest::test_missing_remote_ip tornado/test/web_test.py::HTTPErrorTest::test_copy tornado/test/web_test.py::ApplicationTest::test_listen tornado/test/web_test.py::URLSpecReverseTest::test_non_reversible tornado/test/web_test.py::URLSpecReverseTest::test_reverse tornado/test/web_test.py::URLSpecReverseTest::test_reverse_arguments tornado/test/web_test.py::RedirectHandlerTest::test_basic_redirect tornado/test/web_test.py::RedirectHandlerTest::test_redirect_pattern tornado/test/web_test.py::RedirectHandlerTest::test_redirect_with_appending_argument tornado/test/web_test.py::RedirectHandlerTest::test_redirect_with_argument tornado/test/websocket_test.py::WebSocketTest::test_async_prepare tornado/test/websocket_test.py::WebSocketTest::test_bad_websocket_version tornado/test/websocket_test.py::WebSocketTest::test_binary_message tornado/test/websocket_test.py::WebSocketTest::test_check_origin_invalid tornado/test/websocket_test.py::WebSocketTest::test_check_origin_invalid_partial_url tornado/test/websocket_test.py::WebSocketTest::test_check_origin_invalid_subdomains tornado/test/websocket_test.py::WebSocketTest::test_check_origin_valid_no_path tornado/test/websocket_test.py::WebSocketTest::test_check_origin_valid_with_path tornado/test/websocket_test.py::WebSocketTest::test_client_close_reason tornado/test/websocket_test.py::WebSocketTest::test_coroutine tornado/test/websocket_test.py::WebSocketTest::test_error_in_on_message tornado/test/websocket_test.py::WebSocketTest::test_error_in_open tornado/test/websocket_test.py::WebSocketTest::test_http_request tornado/test/websocket_test.py::WebSocketTest::test_missing_websocket_key tornado/test/websocket_test.py::WebSocketTest::test_open_coroutine tornado/test/websocket_test.py::WebSocketTest::test_path_args tornado/test/websocket_test.py::WebSocketTest::test_render_message tornado/test/websocket_test.py::WebSocketTest::test_server_close_reason tornado/test/websocket_test.py::WebSocketTest::test_subprotocols tornado/test/websocket_test.py::WebSocketTest::test_subprotocols_not_offered tornado/test/websocket_test.py::WebSocketTest::test_unicode_message tornado/test/websocket_test.py::WebSocketTest::test_websocket_callbacks tornado/test/websocket_test.py::WebSocketTest::test_websocket_close_buffered_data tornado/test/websocket_test.py::WebSocketTest::test_websocket_gen tornado/test/websocket_test.py::WebSocketTest::test_websocket_header_echo tornado/test/websocket_test.py::WebSocketTest::test_websocket_headers tornado/test/websocket_test.py::WebSocketTest::test_websocket_http_fail tornado/test/websocket_test.py::WebSocketTest::test_websocket_http_success tornado/test/websocket_test.py::WebSocketTest::test_websocket_network_fail tornado/test/websocket_test.py::WebSocketTest::test_write_after_close tornado/test/websocket_test.py::WebSocketNativeCoroutineTest::test_native_coroutine tornado/test/websocket_test.py::NoCompressionTest::test_message_sizes tornado/test/websocket_test.py::NoCompressionTest::test_size_limit tornado/test/websocket_test.py::ServerOnlyCompressionTest::test_message_sizes tornado/test/websocket_test.py::ServerOnlyCompressionTest::test_size_limit tornado/test/websocket_test.py::ClientOnlyCompressionTest::test_message_sizes tornado/test/websocket_test.py::ClientOnlyCompressionTest::test_size_limit tornado/test/websocket_test.py::DefaultCompressionTest::test_message_sizes tornado/test/websocket_test.py::DefaultCompressionTest::test_size_limit tornado/test/websocket_test.py::PythonMaskFunctionTest::test_mask tornado/test/websocket_test.py::CythonMaskFunctionTest::test_mask tornado/test/websocket_test.py::ServerPeriodicPingTest::test_server_ping tornado/test/websocket_test.py::ClientPeriodicPingTest::test_client_ping tornado/test/websocket_test.py::ManualPingTest::test_manual_ping tornado/test/websocket_test.py::MaxMessageSizeTest::test_large_message
tornado/web.py tornado/websocket.py .flake8 tornado/util.py
tornado/web.py tornado/websocket.py .flake8 tornado/util.py