fix string concats left over by black
This commit is contained in:
parent
3db4697959
commit
53c893b646
10 changed files with 17 additions and 18 deletions
|
|
@ -74,7 +74,7 @@ def create():
|
|||
else:
|
||||
db = get_db()
|
||||
db.execute(
|
||||
"INSERT INTO post (title, body, author_id)" " VALUES (?, ?, ?)",
|
||||
"INSERT INTO post (title, body, author_id) VALUES (?, ?, ?)",
|
||||
(title, body, g.user["id"]),
|
||||
)
|
||||
db.commit()
|
||||
|
|
|
|||
|
|
@ -1931,7 +1931,7 @@ class Flask(_PackageBoundObject):
|
|||
if not from_error_handler:
|
||||
raise
|
||||
self.logger.exception(
|
||||
"Request finalizing failed with an " "error while handling an error"
|
||||
"Request finalizing failed with an error while handling an error"
|
||||
)
|
||||
return response
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ def get_version(ctx, param, value):
|
|||
import werkzeug
|
||||
from . import __version__
|
||||
|
||||
message = "Python %(python)s\n" "Flask %(flask)s\n" "Werkzeug %(werkzeug)s"
|
||||
message = "Python %(python)s\nFlask %(flask)s\nWerkzeug %(werkzeug)s"
|
||||
click.echo(
|
||||
message
|
||||
% {
|
||||
|
|
|
|||
|
|
@ -437,9 +437,10 @@ class RequestContext(object):
|
|||
if app_ctx is not None:
|
||||
app_ctx.pop(exc)
|
||||
|
||||
assert (
|
||||
rv is self
|
||||
), "Popped wrong request context. " "(%r instead of %r)" % (rv, self)
|
||||
assert rv is self, "Popped wrong request context. (%r instead of %r)" % (
|
||||
rv,
|
||||
self,
|
||||
)
|
||||
|
||||
def auto_pop(self, exc):
|
||||
if self.request.environ.get("flask._preserve_context") or (
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ def _endpoint_from_view_func(view_func):
|
|||
"""Internal helper that returns the default endpoint for a given
|
||||
function. This always is the function name.
|
||||
"""
|
||||
assert view_func is not None, "expected view func if endpoint " "is not provided."
|
||||
assert view_func is not None, "expected view func if endpoint is not provided."
|
||||
return view_func.__name__
|
||||
|
||||
|
||||
|
|
@ -598,9 +598,7 @@ def send_file(
|
|||
headers = Headers()
|
||||
if as_attachment:
|
||||
if attachment_filename is None:
|
||||
raise TypeError(
|
||||
"filename unavailable, required for " "sending as attachment"
|
||||
)
|
||||
raise TypeError("filename unavailable, required for sending as attachment")
|
||||
|
||||
if not isinstance(attachment_filename, text_type):
|
||||
attachment_filename = attachment_filename.decode("utf-8")
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ class FlaskClient(Client):
|
|||
"""
|
||||
if self.cookie_jar is None:
|
||||
raise RuntimeError(
|
||||
"Session transactions only make sense " "with cookies enabled."
|
||||
"Session transactions only make sense with cookies enabled."
|
||||
)
|
||||
app = self.application
|
||||
environ_overrides = kwargs.setdefault("environ_overrides", {})
|
||||
|
|
@ -167,7 +167,7 @@ class FlaskClient(Client):
|
|||
sess = session_interface.open_session(app, c.request)
|
||||
if sess is None:
|
||||
raise RuntimeError(
|
||||
"Session backend did not open a session. " "Check the configuration"
|
||||
"Session backend did not open a session. Check the configuration"
|
||||
)
|
||||
|
||||
# Since we have to open a new request context for the session
|
||||
|
|
|
|||
|
|
@ -1726,7 +1726,7 @@ def test_routing_redirect_debugging(app, client):
|
|||
with pytest.raises(AssertionError) as e:
|
||||
client.post("/foo", data={})
|
||||
assert "http://localhost/foo/" in str(e)
|
||||
assert ("Make sure to directly send " "your POST-request to this URL") in str(e)
|
||||
assert ("Make sure to directly send your POST-request to this URL") in str(e)
|
||||
|
||||
rv = client.get("/foo", data={}, follow_redirects=True)
|
||||
assert rv.data == b"success"
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ def test_config_from_envvar_missing(monkeypatch):
|
|||
app.config.from_envvar("FOO_SETTINGS")
|
||||
msg = str(e.value)
|
||||
assert msg.startswith(
|
||||
"[Errno 2] Unable to load configuration " "file (No such file or directory):"
|
||||
"[Errno 2] Unable to load configuration file (No such file or directory):"
|
||||
)
|
||||
assert msg.endswith("missing.cfg'")
|
||||
assert not app.config.from_envvar("FOO_SETTINGS", silent=True)
|
||||
|
|
@ -110,7 +110,7 @@ def test_config_missing():
|
|||
app.config.from_pyfile("missing.cfg")
|
||||
msg = str(e.value)
|
||||
assert msg.startswith(
|
||||
"[Errno 2] Unable to load configuration " "file (No such file or directory):"
|
||||
"[Errno 2] Unable to load configuration file (No such file or directory):"
|
||||
)
|
||||
assert msg.endswith("missing.cfg'")
|
||||
assert not app.config.from_pyfile("missing.cfg", silent=True)
|
||||
|
|
@ -122,7 +122,7 @@ def test_config_missing_json():
|
|||
app.config.from_json("missing.json")
|
||||
msg = str(e.value)
|
||||
assert msg.startswith(
|
||||
"[Errno 2] Unable to load configuration " "file (No such file or directory):"
|
||||
"[Errno 2] Unable to load configuration file (No such file or directory):"
|
||||
)
|
||||
assert msg.endswith("missing.json'")
|
||||
assert not app.config.from_json("missing.json", silent=True)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ def test_installed_module_paths(
|
|||
modules_tmpdir, modules_tmpdir_prefix, purge_module, site_packages, limit_loader
|
||||
):
|
||||
site_packages.join("site_app.py").write(
|
||||
"import flask\n" "app = flask.Flask(__name__)\n"
|
||||
"import flask\napp = flask.Flask(__name__)\n"
|
||||
)
|
||||
purge_module("site_app")
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ def test_request_less_rendering(app, app_ctx):
|
|||
def context_processor():
|
||||
return dict(foo=42)
|
||||
|
||||
rv = flask.render_template_string("Hello {{ config.WORLD_NAME }} " "{{ foo }}")
|
||||
rv = flask.render_template_string("Hello {{ config.WORLD_NAME }} {{ foo }}")
|
||||
assert rv == "Hello Special World 42"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue