Skip to content

Commit

Permalink
fix string concats left over by black
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Jun 1, 2019
1 parent 3db4697 commit 53c893b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/tutorial/flaskr/blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,7 @@ def finalize_request(self, rv, from_error_handler=False):
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

Expand Down
2 changes: 1 addition & 1 deletion src/flask/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
% {
Expand Down
7 changes: 4 additions & 3 deletions src/flask/ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,10 @@ def pop(self, exc=_sentinel):
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 (
Expand Down
6 changes: 2 additions & 4 deletions src/flask/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__


Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/flask/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def session_transaction(self, *args, **kwargs):
"""
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", {})
Expand All @@ -167,7 +167,7 @@ def session_transaction(self, *args, **kwargs):
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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1726,7 +1726,7 @@ def foo():
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"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_instance_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_templating.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"


Expand Down

0 comments on commit 53c893b

Please sign in to comment.