Skip to content

Commit

Permalink
added scope member to TransportProtocol for py3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
azimovMichael committed Apr 25, 2022
1 parent 94639ee commit 1679ac8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions sanic/models/protocol_types.py
Expand Up @@ -2,6 +2,8 @@

from typing import Any, AnyStr, TypeVar, Union

from sanic.models.asgi import ASGIScope


if sys.version_info < (3, 8):
from asyncio import BaseTransport
Expand All @@ -17,6 +19,8 @@
from typing import Protocol

class TransportProtocol(Protocol):
scope: ASGIScope

def get_protocol(self):
...

Expand Down
2 changes: 1 addition & 1 deletion tests/test_requests.py
Expand Up @@ -1051,7 +1051,6 @@ async def handler(request):
assert request.form.get("test") == "" # For request.parsed_form



def test_post_form_urlencoded_drop_blanks(app):
@app.route("/", methods=["POST"])
async def handler(request):
Expand All @@ -1066,6 +1065,7 @@ async def handler(request):

assert "test" not in request.form.keys()


@pytest.mark.asyncio
async def test_post_form_urlencoded_drop_blanks_asgi(app):
@app.route("/", methods=["POST"])
Expand Down

0 comments on commit 1679ac8

Please sign in to comment.