Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Python 3.12 deprecation notice #2959

Merged
merged 6 commits into from
Jun 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update ASGI tests setting port explicitly
  • Loading branch information
ahopkins committed Jun 22, 2024
commit c7563e4c3597b20cbdd8b1183187ba13a70686f3
14 changes: 11 additions & 3 deletions tests/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 18,8 @@
from sanic.server.websockets.connection import WebSocketConnection
from sanic.signals import RESERVED_NAMESPACES

from .conftest import get_port


try:
from unittest.mock import AsyncMock
Expand Down Expand Up @@ -91,7 93,9 @@ class CustomServer(uvicorn.Server):
def install_signal_handlers(self):
pass

config = uvicorn.Config(app=app, loop="asyncio", limit_max_requests=0)
config = uvicorn.Config(
app=app, loop="asyncio", limit_max_requests=0, port=get_port()
)
server = CustomServer(config=config)

start_message = (
Expand Down Expand Up @@ -189,7 193,9 @@ class CustomServer(uvicorn.Server):
def install_signal_handlers(self):
pass

config = uvicorn.Config(app=app, loop="asyncio", limit_max_requests=0)
config = uvicorn.Config(
app=app, loop="asyncio", limit_max_requests=0, port=get_port()
)
server = CustomServer(config=config)

start_message = (
Expand Down Expand Up @@ -261,7 267,9 @@ class CustomServer(uvicorn.Server):
def install_signal_handlers(self):
pass

config = uvicorn.Config(app=app, loop="asyncio", limit_max_requests=0)
config = uvicorn.Config(
app=app, loop="asyncio", limit_max_requests=0, port=get_port()
)
server = CustomServer(config=config)

with pytest.warns(UserWarning) as records:
Expand Down
Loading