* Skip test when brotli is installed
* A better reason message
+import sys
from typing import Optional
import anyio
assert response.json() == {"params": {"a": "123", "b": "456"}}
+@pytest.mark.skipif(
+ any(module in sys.modules for module in ("brotli", "brotlicffi")),
+ reason='urllib3 includes "br" to the "accept-encoding" headers.',
+)
def test_request_headers(test_client_factory):
async def app(scope, receive, send):
request = Request(scope, receive)
+import sys
+
import anyio
import pytest
assert data == {"params": {"a": "abc", "b": "456"}}
+@pytest.mark.skipif(
+ any(module in sys.modules for module in ("brotli", "brotlicffi")),
+ reason='urllib3 includes "br" to the "accept-encoding" headers.',
+)
def test_websocket_headers(test_client_factory):
async def app(scope: Scope, receive: Receive, send: Send) -> None:
websocket = WebSocket(scope, receive=receive, send=send)