Skip to content

Commit

Permalink
Add type annotation on test_logging.py (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Feb 28, 2023
1 parent 188679e commit 8a8b7ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ follow_imports = silent
exclude = (?x)
^(
|tests/protocols/test_websocket.py
|tests/middleware/test_logging.py
|tests/supervisors/test_reload.py
|tests/protocols/test_http.py
|tests/test_auto_detection.py
Expand Down
10 changes: 5 additions & 5 deletions tests/middleware/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
import httpx
import pytest
import websockets
import websockets.client

from tests.utils import run_server
from uvicorn import Config
from uvicorn.protocols.http.h11_impl import H11Protocol

try:
from uvicorn.protocols.http.httptools_impl import HttpToolsProtocol
except ImportError: # pragma: nocover
HttpToolsProtocol = None


HTTP_PROTOCOLS = [p for p in [H11Protocol, HttpToolsProtocol] if p is not None]
HTTP_PROTOCOLS = [H11Protocol, HttpToolsProtocol]
except ImportError: # pragma: nocover
HTTP_PROTOCOLS = [H11Protocol]


@contextlib.contextmanager
Expand Down Expand Up @@ -104,7 +104,7 @@ async def websocket_app(scope, receive, send):
break

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

config = Config(
Expand Down

0 comments on commit 8a8b7ad

Please sign in to comment.