Skip to content

Commit

Permalink
Drop Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Dec 14, 2024
1 parent 5f3e508 commit 70562c7
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 66 deletions.
8 changes: 3 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ h11 @ git+https://github.com/python-hyper/h11.git@master
# Explicit optionals
a2wsgi==1.10.7
wsproto==1.2.0
websockets==13.1
websockets==14.1

# Packaging
build==1.2.2.post1
Expand All @@ -20,11 +20,9 @@ pytest-mock==3.14.0
mypy==1.13.0
types-click==7.1.8
types-pyyaml==6.0.12.20240917
trustme==1.1.0; python_version < '3.9'
trustme==1.2.0; python_version >= '3.9'
trustme==1.2.0
cryptography==44.0.0
coverage==7.6.1; python_version < '3.9'
coverage==7.6.9; python_version >= '3.9'
coverage==7.6.9
coverage-conditional-plugin==0.9.0
httpx==0.28.1

Expand Down
9 changes: 4 additions & 5 deletions tests/middleware/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import httpx
import pytest
import websockets
import websockets.client
from websockets.asyncio.client import connect

from tests.utils import run_server
from uvicorn import Config
Expand Down Expand Up @@ -104,9 +103,9 @@ async def websocket_app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISe
elif message["type"] == "websocket.disconnect":
break

async def open_connection(url):
async with websockets.client.connect(url) as websocket:
return websocket.open
async def open_connection(url: str):
async with connect(url):
return True

config = Config(
app=websocket_app,
Expand Down
4 changes: 2 additions & 2 deletions tests/middleware/test_proxy_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import httpx
import httpx._transports.asgi
import pytest
import websockets.client
from websockets.asyncio.client import connect

from tests.response import Response
from tests.utils import run_server
Expand Down Expand Up @@ -478,7 +478,7 @@ async def websocket_app(scope: Scope, receive: ASGIReceiveCallable, send: ASGISe
async with run_server(config):
url = f"ws://127.0.0.1:{unused_tcp_port}"
headers = {X_FORWARDED_FOR: "1.2.3.4", X_FORWARDED_PROTO: forwarded_proto}
async with websockets.client.connect(url, extra_headers=headers) as websocket:
async with connect(url, additional_headers=headers) as websocket:
data = await websocket.recv()
assert data == expected

Expand Down
Loading

0 comments on commit 70562c7

Please sign in to comment.