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 = Sanic("DelayedResponseApp", strict_slashes=True)
app.config.AUTO_EXTEND = False
@app.get("/") @app.get("/")

View File

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

View File

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

View File

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

View File

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

View File

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