ruff-only #1

Open
leo wants to merge 17 commits from ruff-only into main
4 changed files with 4 additions and 8 deletions
Showing only changes of commit 758f10c513 - Show all commits

View File

@ -22,7 +22,7 @@ def test_bp_group_indexing(app: Sanic):
group = Blueprint.group(blueprint_1, blueprint_2) group = Blueprint.group(blueprint_1, blueprint_2)
assert group[0] == blueprint_1 assert group[0] == blueprint_1
with raises(expected_exception=IndexError) as e: with raises(expected_exception=IndexError):
_ = group[3] _ = group[3]

View File

@ -618,6 +618,6 @@ def test_streaming_echo():
assert res == b"-" assert res == b"-"
res = await read_chunk() res = await read_chunk()
assert res == None assert res is None
app.run(access_log=False, single_process=True) app.run(access_log=False, single_process=True)

View File

@ -2180,7 +2180,7 @@ def test_safe_method_with_body_ignored(app):
) )
assert request.body == b"" assert request.body == b""
assert request.json == None assert request.json is None
assert response.body == b"OK" assert response.body == b"OK"

View File

@ -610,7 +610,7 @@ def test_multiple_responses(
@app.get("/4") @app.get("/4")
async def handler4(request: Request): async def handler4(request: Request):
response = await request.respond(headers={"one": "one"}) await request.respond(headers={"one": "one"})
return json({"foo": "bar"}, headers={"one": "two"}) return json({"foo": "bar"}, headers={"one": "two"})
@app.get("/5") @app.get("/5")
@ -641,10 +641,6 @@ def test_multiple_responses(
"been responded to." "been responded to."
) )
error_msg3 = (
"Response stream was ended, no more "
"response data is allowed to be sent."
)
with caplog.at_level(ERROR): with caplog.at_level(ERROR):
_, response = app.test_client.get("/1") _, response = app.test_client.get("/1")