22.3 Internal version bumps (#2419)

This commit is contained in:
Adam Hopkins 2022-03-31 14:30:30 +03:00 committed by GitHub
parent 874718db94
commit 00218aa9f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 11 deletions

View File

@ -4,6 +4,7 @@ from sanic import Sanic, response
app = Sanic("DelayedResponseApp", strict_slashes=True)
app.config.AUTO_EXTEND = False
@app.get("/")

View File

@ -11,7 +11,6 @@ from asyncio import (
CancelledError,
Task,
ensure_future,
get_event_loop_policy,
get_running_loop,
wait_for,
)
@ -253,7 +252,7 @@ class Sanic(BaseSanic, RunnerMixin, metaclass=TouchUpMeta):
"Loop can only be retrieved after the app has started "
"running. Not supported with `create_server` function"
)
return get_event_loop_policy().get_event_loop()
return get_running_loop()
# -------------------------------------------------------------------- #
# Registration

View File

@ -84,7 +84,7 @@ ujson = "ujson>=1.35" + env_dependency
uvloop = "uvloop>=0.5.3" + env_dependency
types_ujson = "types-ujson" + env_dependency
requirements = [
"sanic-routing~=0.7",
"sanic-routing>=22.3.0,<22.6.0",
"httptools>=0.0.10",
uvloop,
ujson,
@ -94,7 +94,7 @@ requirements = [
]
tests_require = [
"sanic-testing>=0.7.0",
"sanic-testing>=22.3.0",
"pytest==6.2.5",
"coverage==5.3",
"gunicorn==20.0.4",

View File

@ -164,11 +164,12 @@ def test_raw_headers(app):
},
)
assert request.raw_headers == (
b"Host: example.com\r\nAccept: */*\r\nAccept-Encoding: gzip, "
b"deflate\r\nConnection: keep-alive\r\nUser-Agent: "
b"Sanic-Testing\r\nFOO: bar"
)
assert b"Host: example.com" in request.raw_headers
assert b"Accept: */*" in request.raw_headers
assert b"Accept-Encoding: gzip, deflate" in request.raw_headers
assert b"Connection: keep-alive" in request.raw_headers
assert b"User-Agent: Sanic-Testing" in request.raw_headers
assert b"FOO: bar" in request.raw_headers
def test_request_line(app):

View File

@ -254,7 +254,7 @@ def test_route_strict_slash(app):
def test_route_invalid_parameter_syntax(app):
with pytest.raises(ValueError):
with pytest.raises(InvalidUsage):
@app.get("/get/<:str>", strict_slashes=True)
def handler(request):

View File

@ -199,7 +199,7 @@ async def test_zero_downtime():
for _ in range(40):
async with httpx.AsyncClient(transport=transport) as client:
r = await client.get("http://localhost/sleep/0.1")
assert r.status_code == 200, r.content
assert r.status_code == 200, r.text
assert r.text == "Slept 0.1 seconds.\n"
def spawn():