diff --git a/sanic/app.py b/sanic/app.py index eb702b5dba..fe6d270875 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -1035,7 +1035,7 @@ async def handle_request(self, request): def test_client(self): if self._test_client: return self._test_client - from sanic_testing.testing import SanicTestClient + from sanic_testing.testing import SanicTestClient # type: ignore self._test_client = SanicTestClient(self) return self._test_client @@ -1044,7 +1044,7 @@ def test_client(self): def asgi_client(self): if self._asgi_client: return self._asgi_client - from sanic_testing.testing import SanicASGITestClient + from sanic_testing.testing import SanicASGITestClient # type: ignore self._asgi_client = SanicASGITestClient(self) return self._asgi_client diff --git a/tests/test_logo.py b/tests/test_logo.py index c3206513a4..3fff32db30 100644 --- a/tests/test_logo.py +++ b/tests/test_logo.py @@ -6,14 +6,6 @@ from sanic.config import BASE_LOGO -try: - import uvloop # noqa - - ROW = 0 -except BaseException: - ROW = 1 - - def test_logo_base(app, caplog): server = app.create_server( debug=True, return_asyncio_server=True, port=PORT @@ -29,8 +21,8 @@ def test_logo_base(app, caplog): loop.run_until_complete(_server.wait_closed()) app.stop() - assert caplog.record_tuples[ROW][1] == logging.DEBUG - assert caplog.record_tuples[ROW][2] == BASE_LOGO + assert caplog.record_tuples[0][1] == logging.DEBUG + assert caplog.record_tuples[0][2] == BASE_LOGO def test_logo_false(app, caplog): @@ -50,8 +42,8 @@ def test_logo_false(app, caplog): loop.run_until_complete(_server.wait_closed()) app.stop() - banner, port = caplog.record_tuples[ROW][2].rsplit(":", 1) - assert caplog.record_tuples[ROW][1] == logging.INFO + banner, port = caplog.record_tuples[0][2].rsplit(":", 1) + assert caplog.record_tuples[0][1] == logging.INFO assert banner == "Goin' Fast @ http://127.0.0.1" assert int(port) > 0 @@ -73,8 +65,8 @@ def test_logo_true(app, caplog): loop.run_until_complete(_server.wait_closed()) app.stop() - assert caplog.record_tuples[ROW][1] == logging.DEBUG - assert caplog.record_tuples[ROW][2] == BASE_LOGO + assert caplog.record_tuples[0][1] == logging.DEBUG + assert caplog.record_tuples[0][2] == BASE_LOGO def test_logo_custom(app, caplog): @@ -94,5 +86,5 @@ def test_logo_custom(app, caplog): loop.run_until_complete(_server.wait_closed()) app.stop() - assert caplog.record_tuples[ROW][1] == logging.DEBUG - assert caplog.record_tuples[ROW][2] == "My Custom Logo" + assert caplog.record_tuples[0][1] == logging.DEBUG + assert caplog.record_tuples[0][2] == "My Custom Logo"