Skip to content

Commit

Permalink
22.3 Internal version bumps (#2419)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins authored Mar 31, 2022
1 parent 874718d commit 00218aa
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions examples/delayed_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


app = Sanic("DelayedResponseApp", strict_slashes=True)
app.config.AUTO_EXTEND = False


@app.get("/")
Expand Down
3 changes: 1 addition & 2 deletions sanic/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
CancelledError,
Task,
ensure_future,
get_event_loop_policy,
get_running_loop,
wait_for,
)
Expand Down Expand Up @@ -253,7 +252,7 @@ def loop(self):
"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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def open_local(paths, mode="r", encoding="utf8"):
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,
Expand All @@ -94,7 +94,7 @@ def open_local(paths, mode="r", encoding="utf8"):
]

tests_require = [
"sanic-testing>=0.7.0",
"sanic-testing>=22.3.0",
"pytest==6.2.5",
"coverage==5.3",
"gunicorn==20.0.4",
Expand Down
11 changes: 6 additions & 5 deletions tests/test_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def handler2(request):


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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_unix_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async def client():
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():
Expand Down

0 comments on commit 00218aa

Please sign in to comment.