from tests that no longer produce any logs.
from __future__ import absolute_import, division, with_statement
from tornado.auth import OpenIdMixin, OAuthMixin, OAuth2Mixin
from tornado.escape import json_decode
-from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase
+from tornado.testing import AsyncHTTPTestCase
from tornado.util import b
from tornado.web import RequestHandler, Application, asynchronous
self.authorize_redirect()
-class AuthTest(AsyncHTTPTestCase, LogTrapTestCase):
+class AuthTest(AsyncHTTPTestCase):
def get_app(self):
return Application(
[
from tornado.httpclient import AsyncHTTPClient
from tornado.iostream import IOStream
from tornado import netutil
-from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase, get_unused_port
+from tornado.testing import AsyncHTTPTestCase, get_unused_port
from tornado.util import b, bytes_type
from tornado.web import Application, RequestHandler, url
# test suite.
-class HTTPClientCommonTestCase(AsyncHTTPTestCase, LogTrapTestCase):
+class HTTPClientCommonTestCase(AsyncHTTPTestCase):
def get_app(self):
return Application([
url("/hello", HelloWorldHandler),
ssl = None
-class HandlerBaseTestCase(AsyncHTTPTestCase, LogTrapTestCase):
+class HandlerBaseTestCase(AsyncHTTPTestCase):
def get_app(self):
return Application([('/', self.__class__.Handler)])
# This test is also called from wsgi_test
-class HTTPConnectionTest(AsyncHTTPTestCase, LogTrapTestCase):
+class HTTPConnectionTest(AsyncHTTPTestCase):
def get_handlers(self):
return [("/multipart", MultipartTestHandler),
("/hello", HelloWorldRequestHandler)]
actual_type)
-class HTTPServerTest(AsyncHTTPTestCase, LogTrapTestCase):
+class HTTPServerTest(AsyncHTTPTestCase):
def get_app(self):
return Application([("/echo", EchoHandler),
("/typecheck", TypeCheckHandler),
"127.0.0.1")
-class UnixSocketTest(AsyncTestCase, LogTrapTestCase):
+class UnixSocketTest(AsyncTestCase):
"""HTTPServers can listen on Unix sockets too.
Why would you want to do this? Nginx can proxy to backends listening
from tornado.ioloop import IOLoop
from tornado.netutil import bind_sockets
-from tornado.testing import AsyncTestCase, LogTrapTestCase, get_unused_port
+from tornado.testing import AsyncTestCase, get_unused_port
from tornado.test.util import unittest
-class TestIOLoop(AsyncTestCase, LogTrapTestCase):
+class TestIOLoop(AsyncTestCase):
def test_add_callback_wakeup(self):
# Make sure that add_callback from inside a running IOLoop
# wakes up the IOLoop immediately instead of waiting for a timeout.
#!/usr/bin/env python
from __future__ import absolute_import, division, with_statement
+import logging
import textwrap
import sys
from tornado.test.util import unittest
warnings.filterwarnings("error", category=DeprecationWarning,
module=r"tornado\..*")
+ logging.getLogger("tornado.access").setLevel(logging.CRITICAL)
+
import tornado.testing
kwargs = {}
if sys.version_info >= (3, 2):
response.error)
-class CreateAsyncHTTPClientTestCase(AsyncTestCase, LogTrapTestCase):
+class CreateAsyncHTTPClientTestCase(AsyncTestCase):
def setUp(self):
super(CreateAsyncHTTPClientTestCase, self).setUp()
self.saved = AsyncHTTPClient._save_configuration()
self.assertEqual(client.max_clients, 14)
-class HTTP100ContinueTestCase(AsyncHTTPTestCase, LogTrapTestCase):
+class HTTP100ContinueTestCase(AsyncHTTPTestCase):
def respond_100(self, request):
self.request = request
self.request.connection.stream.write(
from tornado.escape import utf8, native_str, to_unicode
from tornado.template import Template, DictLoader, ParseError, Loader
from tornado.testing import LogTrapTestCase
+from tornado.test.util import unittest
from tornado.util import b, bytes_type, ObjectDict
-class TemplateTest(LogTrapTestCase):
+class TemplateTest(unittest.TestCase):
def test_simple(self):
template = Template("Hello {{ name }}!")
self.assertEqual(template.generate(name="Ben"),
traceback.format_exc())
-class AutoEscapeTest(LogTrapTestCase):
+class AutoEscapeTest(unittest.TestCase):
def setUp(self):
self.templates = {
"escaped.html": "{% autoescape xhtml_escape %}{{ name }}",
b("""s = "['not a string']"\n"""))
-class TemplateLoaderTest(LogTrapTestCase):
+class TemplateLoaderTest(unittest.TestCase):
def setUp(self):
self.loader = Loader(os.path.join(os.path.dirname(__file__), "templates"))
from __future__ import absolute_import, division, with_statement
import time
-from tornado.testing import AsyncTestCase, LogTrapTestCase
+from tornado.testing import AsyncTestCase
from tornado.test.util import unittest
-class AsyncTestCaseTest(AsyncTestCase, LogTrapTestCase):
+class AsyncTestCaseTest(AsyncTestCase):
def test_exception_in_callback(self):
self.io_loop.add_callback(lambda: 1 / 0)
try:
self.send_error(500)
-class AuthRedirectTest(AsyncHTTPTestCase, LogTrapTestCase):
+class AuthRedirectTest(AsyncHTTPTestCase):
def get_app(self):
return Application([('/relative', AuthRedirectRequestHandler,
dict(login_url='/login')),
args=recursive_unicode(self.request.arguments)))
-class RequestEncodingTest(AsyncHTTPTestCase, LogTrapTestCase):
+class RequestEncodingTest(AsyncHTTPTestCase):
def get_app(self):
return Application([
("/group/(.*)", EchoHandler),
# This test is shared with wsgi_test.py
-class WSGISafeWebTest(AsyncHTTPTestCase, LogTrapTestCase):
+class WSGISafeWebTest(AsyncHTTPTestCase):
COOKIE_SECRET = "WebTest.COOKIE_SECRET"
def get_app(self):
self.assertEqual(response.body, b("ok"))
-class NonWSGIWebTests(AsyncHTTPTestCase, LogTrapTestCase):
+class NonWSGIWebTests(AsyncHTTPTestCase):
def get_app(self):
urls = [
("/flow_control", FlowControlHandler),
self.assertEqual(b(""), response.body)
-class StaticFileTest(AsyncHTTPTestCase, LogTrapTestCase):
+class StaticFileTest(AsyncHTTPTestCase):
def get_app(self):
class StaticUrlHandler(RequestHandler):
def get(self, path):
self.assertEqual(response.body, b("/static/foo.42.txt"))
-class NamedURLSpecGroupsTest(AsyncHTTPTestCase, LogTrapTestCase):
+class NamedURLSpecGroupsTest(AsyncHTTPTestCase):
def get_app(self):
class EchoHandler(RequestHandler):
def get(self, path):
from tornado.escape import json_decode
from tornado.test.httpserver_test import TypeCheckHandler
-from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase
+from tornado.testing import AsyncHTTPTestCase
from tornado.util import b
from tornado.web import RequestHandler
from tornado.wsgi import WSGIApplication, WSGIContainer
-class WSGIContainerTest(AsyncHTTPTestCase, LogTrapTestCase):
+class WSGIContainerTest(AsyncHTTPTestCase):
def wsgi_app(self, environ, start_response):
status = "200 OK"
response_headers = [("Content-Type", "text/plain")]
self.assertEqual(response.body, b("Hello world!"))
-class WSGIApplicationTest(AsyncHTTPTestCase, LogTrapTestCase):
+class WSGIApplicationTest(AsyncHTTPTestCase):
def get_app(self):
class HelloHandler(RequestHandler):
def get(self):