File tree Expand file tree Collapse file tree 3 files changed +104
-2
lines changed Expand file tree Collapse file tree 3 files changed +104
-2
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,9 @@ dev = [
4646 " pytest-asyncio>=0.25.1" ,
4747 " pytest-cov>=5.0.0" ,
4848 " pytest>=8.3.3" ,
49+ " starlette-cramjam>=0.4.0" ,
4950]
5051
5152[tool .pytest .ini_options ]
5253asyncio_default_fixture_loop_scope = " function"
53- asyncio_mode = " auto"
54+ asyncio_mode = " auto"
Original file line number Diff line number Diff line change 1010import uvicorn
1111from fastapi import FastAPI
1212from jwcrypto import jwk , jwt
13+ from starlette_cramjam .middleware import CompressionMiddleware
1314from utils import single_chunk_async_stream_response
1415
1516
@@ -69,6 +70,8 @@ def source_api():
6970 """Create upstream API for testing purposes."""
7071 app = FastAPI (docs_url = "/api.html" , openapi_url = "/api" )
7172
73+ app .add_middleware (CompressionMiddleware , minimum_size = 0 , compression_level = 1 )
74+
7275 for path , methods in {
7376 "/" : [
7477 "GET" ,
@@ -118,7 +121,7 @@ def source_api():
118121 return app
119122
120123
121- @pytest .fixture ( scope = "session" )
124+ @pytest .fixture
122125def source_api_server (source_api ):
123126 """Run the source API in a background thread."""
124127 host , port = "127.0.0.1" , 9119
You can’t perform that action at this time.
0 commit comments