From: Ben Darnell Date: Wed, 30 Sep 2015 03:57:38 +0000 (-0400) Subject: Run latest autopep8 X-Git-Tag: v4.3.0b1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f03438d8782cf34517c9ae786f65a1820e3d223;p=thirdparty%2Ftornado.git Run latest autopep8 --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 0bad0acd6..4e304f890 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -1282,7 +1282,7 @@ class SSLIOStream(IOStream): # those errors quiet as well. # https://groups.google.com/forum/?fromgroups#!topic/python-tornado/ApucKJat1_0 if (self._is_connreset(err) or - err.args[0] in (errno.EBADF, errno.ENOTCONN)): + err.args[0] in (errno.EBADF, errno.ENOTCONN)): return self.close(exc_info=True) raise except AttributeError: diff --git a/tornado/test/auth_test.py b/tornado/test/auth_test.py index 3ed40e45b..59c96b232 100644 --- a/tornado/test/auth_test.py +++ b/tornado/test/auth_test.py @@ -142,10 +142,10 @@ class FacebookClientLoginHandler(RequestHandler, FacebookGraphMixin): code=self.get_argument("code")) self.write(user) else: - yield self.authorize_redirect( - redirect_uri=self.request.full_url(), - client_id=self.settings["facebook_api_key"], - extra_params={"scope": "read_stream,offline_access"}) + yield self.authorize_redirect( + redirect_uri=self.request.full_url(), + client_id=self.settings["facebook_api_key"], + extra_params={"scope": "read_stream,offline_access"}) class FacebookServerAccessTokenHandler(RequestHandler): @@ -514,9 +514,9 @@ class GoogleOAuth2UserinfoHandler(RequestHandler): assert self.get_argument('access_token') == 'fake-access-token' # return a fake user self.finish({ - 'name': 'Foo', - 'email': 'foo@example.com' - }) + 'name': 'Foo', + 'email': 'foo@example.com' + }) class GoogleOAuth2Test(AsyncHTTPTestCase): diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py index d37e09365..744dc4046 100644 --- a/tornado/test/gen_test.py +++ b/tornado/test/gen_test.py @@ -411,9 +411,9 @@ class GenEngineTest(AsyncTestCase): # Exception logging may be explicitly quieted. with self.assertRaises(RuntimeError): - yield gen.Multi([self.async_exception(RuntimeError("error 1")), - self.async_exception(RuntimeError("error 2"))], - quiet_exceptions=RuntimeError) + yield gen.Multi([self.async_exception(RuntimeError("error 1")), + self.async_exception(RuntimeError("error 2"))], + quiet_exceptions=RuntimeError) @gen_test def test_multi_future_exceptions(self): @@ -430,10 +430,10 @@ class GenEngineTest(AsyncTestCase): # Exception logging may be explicitly quieted. with self.assertRaises(RuntimeError): - yield gen.multi_future( - [self.async_exception(RuntimeError("error 1")), - self.async_exception(RuntimeError("error 2"))], - quiet_exceptions=RuntimeError) + yield gen.multi_future( + [self.async_exception(RuntimeError("error 1")), + self.async_exception(RuntimeError("error 2"))], + quiet_exceptions=RuntimeError) def test_arguments(self): @gen.engine @@ -938,6 +938,7 @@ class GenCoroutineTest(AsyncTestCase): self.finished = True + class GenSequenceHandler(RequestHandler): @asynchronous @gen.engine @@ -1324,7 +1325,6 @@ class WaitIteratorTest(AsyncTestCase): yield namespace['f']() self.assertTrue(self.finished) - @gen_test def test_no_ref(self): # In this usage, there is no direct hard reference to the diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py index b445032af..859d817d0 100644 --- a/tornado/test/httpserver_test.py +++ b/tornado/test/httpserver_test.py @@ -177,12 +177,12 @@ class BadSSLOptionsTest(unittest.TestCase): self.assertRaises((ValueError, IOError), HTTPServer, application, ssl_options={ "certfile": "/__mising__.crt", - }) + }) self.assertRaises((ValueError, IOError), HTTPServer, application, ssl_options={ "certfile": existing_certificate, "keyfile": "/__missing__.key" - }) + }) # This actually works because both files exist HTTPServer(application, ssl_options={ diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py index b74fdcbf1..3f25f3eed 100644 --- a/tornado/test/httputil_test.py +++ b/tornado/test/httputil_test.py @@ -319,6 +319,7 @@ Foo: even self.assertEqual(headers['quux'], 'xyzzy') self.assertEqual(sorted(headers.get_all()), [('Foo', 'bar'), ('Quux', 'xyzzy')]) + class FormatTimestampTest(unittest.TestCase): # Make sure that all the input types are supported. TIMESTAMP = 1359312200.503611 diff --git a/tornado/test/ioloop_test.py b/tornado/test/ioloop_test.py index c914b1c74..0711282e3 100644 --- a/tornado/test/ioloop_test.py +++ b/tornado/test/ioloop_test.py @@ -441,7 +441,6 @@ class TestIOLoopCurrent(unittest.TestCase): # Now that the loop is stopped, it is no longer current. self.assertIsNone(IOLoop.current(instance=False)) - def test_force_current(self): self.io_loop = IOLoop(make_current=True) self.assertIs(self.io_loop, IOLoop.current()) diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py index 5214c1e45..d478071f3 100644 --- a/tornado/test/simple_httpclient_test.py +++ b/tornado/test/simple_httpclient_test.py @@ -107,7 +107,7 @@ class NoContentLengthHandler(RequestHandler): # level so we have to go around it. stream = self.request.connection.detach() stream.write(b"HTTP/1.0 200 OK\r\n\r\n" - b"hello") + b"hello") stream.close() else: self.finish('HTTP/1 required') @@ -668,22 +668,22 @@ class MaxBodySizeTest(AsyncHTTPTestCase): def get_app(self): class SmallBody(RequestHandler): def get(self): - self.write("a"*1024*64) + self.write("a" * 1024 * 64) class LargeBody(RequestHandler): def get(self): - self.write("a"*1024*100) + self.write("a" * 1024 * 100) return Application([('/small', SmallBody), ('/large', LargeBody)]) def get_http_client(self): - return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024*64) + return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024 * 64) def test_small_body(self): response = self.fetch('/small') response.rethrow() - self.assertEqual(response.body, b'a'*1024*64) + self.assertEqual(response.body, b'a' * 1024 * 64) def test_large_body(self): with ExpectLog(gen_log, "Malformed HTTP message from None: Content-Length too long"): @@ -696,15 +696,15 @@ class MaxBufferSizeTest(AsyncHTTPTestCase): class LargeBody(RequestHandler): def get(self): - self.write("a"*1024*100) + self.write("a" * 1024 * 100) return Application([('/large', LargeBody)]) def get_http_client(self): # 100KB body with 64KB buffer - return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024*100, max_buffer_size=1024*64) + return SimpleAsyncHTTPClient(io_loop=self.io_loop, max_body_size=1024 * 100, max_buffer_size=1024 * 64) def test_large_body(self): response = self.fetch('/large') response.rethrow() - self.assertEqual(response.body, b'a'*1024*100) + self.assertEqual(response.body, b'a' * 1024 * 100) diff --git a/tornado/test/tcpserver_test.py b/tornado/test/tcpserver_test.py index 84c950769..d85076a44 100644 --- a/tornado/test/tcpserver_test.py +++ b/tornado/test/tcpserver_test.py @@ -18,7 +18,7 @@ class TCPServerTest(AsyncTestCase): def handle_stream(self, stream, address): yield gen.moment stream.close() - 1/0 + 1 / 0 server = client = None try: diff --git a/tornado/test/template_test.py b/tornado/test/template_test.py index 0c8eb51cb..031b2f540 100644 --- a/tornado/test/template_test.py +++ b/tornado/test/template_test.py @@ -272,7 +272,7 @@ class ParseErrorDetailTest(unittest.TestCase): def test_details(self): loader = DictLoader({ "foo.html": "\n\n{{", - }) + }) with self.assertRaises(ParseError) as cm: loader.load("foo.html") self.assertEqual("Missing end expression }} at foo.html:3", @@ -448,7 +448,7 @@ raw: {% raw name %}""", templates = { "foo.html": "\t\tfoo\n\n", "bar.txt": "\t\tbar\n\n", - } + } loader = DictLoader(templates, whitespace='all') self.assertEqual(loader.load("foo.html").generate(), b"\t\tfoo\n\n") self.assertEqual(loader.load("bar.txt").generate(), b"\t\tbar\n\n") diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py index 3acbbfd95..f04db9597 100644 --- a/tornado/test/web_test.py +++ b/tornado/test/web_test.py @@ -1638,10 +1638,10 @@ class ExceptionHandlerTest(SimpleHandlerTestCase): class BuggyLoggingTest(SimpleHandlerTestCase): class Handler(RequestHandler): def get(self): - 1/0 + 1 / 0 def log_exception(self, typ, value, tb): - 1/0 + 1 / 0 def test_buggy_log_exception(self): # Something gets logged even though the application's