From f3f4a72eb35d37e6cd35d0ba1425825507866f82 Mon Sep 17 00:00:00 2001 From: Jakob Bowyer Date: Wed, 29 Mar 2017 09:15:53 +0100 Subject: [PATCH] Marked skipped tests. Flake8 pass. --- sanic/config.py | 2 ++ sanic/response.py | 6 +++++- tests/test_payload_too_large.py | 5 ++++- tests/test_request_timeout.py | 11 ++++++++--- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/sanic/config.py b/sanic/config.py index 9fb09cbf..406c44e6 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -1,8 +1,10 @@ import os + import types SANIC_PREFIX = 'SANIC_' + class Config(dict): def __init__(self, defaults=None, load_env=True): super().__init__(defaults or {}) diff --git a/sanic/response.py b/sanic/response.py index 38cd68db..74464dfa 100644 --- a/sanic/response.py +++ b/sanic/response.py @@ -331,7 +331,11 @@ def stream( :param headers: Custom Headers. """ return StreamingHTTPResponse( - streaming_fn, headers=headers, content_type=content_type, status=status) + streaming_fn, + headers=headers, + content_type=content_type, + status=status + ) def redirect(to, headers=None, status=302, diff --git a/tests/test_payload_too_large.py b/tests/test_payload_too_large.py index a1a58d3d..7a17dcdf 100644 --- a/tests/test_payload_too_large.py +++ b/tests/test_payload_too_large.py @@ -1,6 +1,8 @@ +import pytest + from sanic import Sanic -from sanic.response import text from sanic.exceptions import PayloadTooLarge +from sanic.response import text data_received_app = Sanic('data_received') data_received_app.config.REQUEST_MAX_SIZE = 1 @@ -43,6 +45,7 @@ async def handler3(request): return text('OK') +@pytest.mark.skip("https://github.com/channelcat/sanic/issues/598") def test_payload_too_large_at_on_header_default(): data = 'a' * 1000 response = on_header_default_app.test_client.post( diff --git a/tests/test_request_timeout.py b/tests/test_request_timeout.py index 404aec12..eec4bc2c 100644 --- a/tests/test_request_timeout.py +++ b/tests/test_request_timeout.py @@ -1,8 +1,11 @@ -from sanic import Sanic import asyncio -from sanic.response import text -from sanic.exceptions import RequestTimeout + +import pytest + +from sanic import Sanic from sanic.config import Config +from sanic.exceptions import RequestTimeout +from sanic.response import text Config.REQUEST_TIMEOUT = 1 request_timeout_app = Sanic('test_request_timeout') @@ -20,6 +23,7 @@ def handler_exception(request, exception): return text('Request Timeout from error_handler.', 408) +@pytest.mark.skip("https://github.com/channelcat/sanic/issues/598") def test_server_error_request_timeout(): request, response = request_timeout_app.test_client.get('/1') assert response.status == 408 @@ -32,6 +36,7 @@ async def handler_2(request): return text('OK') +@pytest.mark.skip("https://github.com/channelcat/sanic/issues/598") def test_default_server_error_request_timeout(): request, response = request_timeout_default_app.test_client.get('/1') assert response.status == 408