use ruff linter and formatter

This commit is contained in:
David Lord 2023-11-09 09:20:27 -08:00
parent 6edfd78c9f
commit 54ff9b2972
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
26 changed files with 99 additions and 128 deletions

View file

@ -219,7 +219,7 @@ def test_test_client_context_binding(app, client):
@app.route("/other")
def other():
1 // 0
raise ZeroDivisionError
with client:
resp = client.get("/")
@ -227,18 +227,15 @@ def test_test_client_context_binding(app, client):
assert resp.data == b"Hello World!"
assert resp.status_code == 200
with client:
resp = client.get("/other")
assert not hasattr(flask.g, "value")
assert b"Internal Server Error" in resp.data
assert resp.status_code == 500
flask.g.value = 23
try:
flask.g.value
except (AttributeError, RuntimeError):
pass
else:
raise AssertionError("some kind of exception expected")
with pytest.raises(RuntimeError):
flask.g.value # noqa: B018
def test_reuse_client(client):