From 00f3641a5a4551fca1a12487c5aa90405fbb8c73 Mon Sep 17 00:00:00 2001 From: Marcin Deranek Date: Thu, 29 Feb 2024 21:54:21 +0100 Subject: dev-python/uvicorn add missing patch --- dev-python/uvicorn/files/uvicorn-0.25.0-test.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dev-python/uvicorn/files/uvicorn-0.25.0-test.patch diff --git a/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch b/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch new file mode 100644 index 0000000..8cd1cc7 --- /dev/null +++ b/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch @@ -0,0 +1,46 @@ +From 64013e8729afc93880a749974491ab5a90b29deb Mon Sep 17 00:00:00 2001 +From: Marcelo Trylesinski +Date: Tue, 26 Dec 2023 10:28:55 +0100 +Subject: [PATCH] Allow test suite to run without httptools installed + +--- + tests/protocols/test_http.py | 19 +++++++------------ + 1 file changed, 7 insertions(+), 12 deletions(-) + +diff --git a/tests/protocols/test_http.py b/tests/protocols/test_http.py +index fde4cc70b..ca06b33a6 100644 +--- a/tests/protocols/test_http.py ++++ b/tests/protocols/test_http.py +@@ -994,25 +994,20 @@ async def test_huge_headers_h11_max_incomplete(): + + + @pytest.mark.anyio +-@pytest.mark.parametrize( +- "protocol_cls,close_header", +- ( +- pytest.param( +- HttpToolsProtocol, b"connection: close", marks=skip_if_no_httptools +- ), +- (H11Protocol, b"Connection: close"), +- ), +-) +-async def test_return_close_header(protocol_cls, close_header: bytes): ++async def test_return_close_header( ++ http_protocol_cls: "Type[HttpToolsProtocol | H11Protocol]" ++): + app = Response("Hello, world", media_type="text/plain") + +- protocol = get_connected_protocol(app, protocol_cls) ++ protocol = get_connected_protocol(app, http_protocol_cls) + protocol.data_received(CONNECTION_CLOSE_REQUEST) + await protocol.loop.run_one() + assert b"HTTP/1.1 200 OK" in protocol.transport.buffer + assert b"content-type: text/plain" in protocol.transport.buffer + assert b"content-length: 12" in protocol.transport.buffer +- assert close_header in protocol.transport.buffer ++ # NOTE: We need to use `.lower()` because H11 implementation doesn't allow Uvicorn ++ # to lowercase them. See: https://github.com/python-hyper/h11/issues/156 ++ assert b"connection: close" in protocol.transport.buffer.lower() + + + @pytest.mark.anyio -- cgit v1.2.3