forked from orbit-oss/flask
use ruff linter and formatter
This commit is contained in:
parent
6edfd78c9f
commit
54ff9b2972
26 changed files with 99 additions and 128 deletions
|
|
@ -19,7 +19,6 @@ from werkzeug.routing import RequestRedirect
|
|||
|
||||
import flask
|
||||
|
||||
|
||||
require_cpython_gc = pytest.mark.skipif(
|
||||
python_implementation() != "CPython",
|
||||
reason="Requires CPython GC behavior",
|
||||
|
|
@ -190,7 +189,8 @@ def test_url_mapping(app, client):
|
|||
|
||||
|
||||
def test_werkzeug_routing(app, client):
|
||||
from werkzeug.routing import Submount, Rule
|
||||
from werkzeug.routing import Rule
|
||||
from werkzeug.routing import Submount
|
||||
|
||||
app.url_map.add(
|
||||
Submount("/foo", [Rule("/bar", endpoint="bar"), Rule("/", endpoint="index")])
|
||||
|
|
@ -210,7 +210,8 @@ def test_werkzeug_routing(app, client):
|
|||
|
||||
|
||||
def test_endpoint_decorator(app, client):
|
||||
from werkzeug.routing import Submount, Rule
|
||||
from werkzeug.routing import Rule
|
||||
from werkzeug.routing import Submount
|
||||
|
||||
app.url_map.add(
|
||||
Submount("/foo", [Rule("/bar", endpoint="bar"), Rule("/", endpoint="index")])
|
||||
|
|
@ -431,9 +432,9 @@ def test_session_special_types(app, client):
|
|||
client.get("/")
|
||||
s = flask.session
|
||||
assert s["t"] == (1, 2, 3)
|
||||
assert type(s["b"]) is bytes
|
||||
assert type(s["b"]) is bytes # noqa: E721
|
||||
assert s["b"] == b"\xff"
|
||||
assert type(s["m"]) is Markup
|
||||
assert type(s["m"]) is Markup # noqa: E721
|
||||
assert s["m"] == Markup("<html>")
|
||||
assert s["u"] == the_uuid
|
||||
assert s["d"] == now
|
||||
|
|
@ -784,7 +785,7 @@ def test_teardown_request_handler_error(app, client):
|
|||
|
||||
@app.route("/")
|
||||
def fails():
|
||||
1 // 0
|
||||
raise ZeroDivisionError
|
||||
|
||||
rv = client.get("/")
|
||||
assert rv.status_code == 500
|
||||
|
|
@ -851,7 +852,7 @@ def test_error_handling(app, client):
|
|||
|
||||
@app.route("/error")
|
||||
def error():
|
||||
1 // 0
|
||||
raise ZeroDivisionError
|
||||
|
||||
@app.route("/forbidden")
|
||||
def error2():
|
||||
|
|
@ -877,7 +878,7 @@ def test_error_handling_processing(app, client):
|
|||
|
||||
@app.route("/")
|
||||
def broken_func():
|
||||
1 // 0
|
||||
raise ZeroDivisionError
|
||||
|
||||
@app.after_request
|
||||
def after_request(resp):
|
||||
|
|
@ -1047,12 +1048,13 @@ def test_error_handler_after_processor_error(app, client):
|
|||
@app.before_request
|
||||
def before_request():
|
||||
if _trigger == "before":
|
||||
1 // 0
|
||||
raise ZeroDivisionError
|
||||
|
||||
@app.after_request
|
||||
def after_request(response):
|
||||
if _trigger == "after":
|
||||
1 // 0
|
||||
raise ZeroDivisionError
|
||||
|
||||
return response
|
||||
|
||||
@app.route("/")
|
||||
|
|
@ -1507,7 +1509,7 @@ def test_exception_propagation(app, client, key):
|
|||
|
||||
@app.route("/")
|
||||
def index():
|
||||
1 // 0
|
||||
raise ZeroDivisionError
|
||||
|
||||
if key is not None:
|
||||
app.config[key] = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue