fix string concats left over by black
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 3db4697 · Browse files · 10 files·+17 added−18 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
10 files+17 added−18 removed
- tests:+6 added−6 removed
- other:+11 added−12 removed
Provenance
- Commit
53c893b- Tree
ebcdf71- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
3db4697
10 files changed+17 added−18 removed
modified:examples/tutorial/flaskr/blog.py+1 added-1 removed
72 unmodified lines73 flash(error)74 else:75 db = get_db()76 db.execute(77- "INSERT INTO post (title, body, author_id)" " VALUES (?, ?, ?)",77+ "INSERT INTO post (title, body, author_id) VALUES (?, ?, ?)",78 (title, body, g.user["id"]),79 )80 db.commit()81 return redirect(url_for("blog.index"))44 unmodified linesmodified:src/flask/app.py+1 added-1 removed
1929 unmodified lines1930 except Exception:1931 if not from_error_handler:1932 raise1933 self.logger.exception(1934- "Request finalizing failed with an " "error while handling an error"1934+ "Request finalizing failed with an error while handling an error"1935 )1936 return response1937 1938 def try_trigger_before_first_request_functions(self):487 unmodified linesmodified:src/flask/cli.py+1 added-1 removed
264 unmodified lines265 266 import werkzeug267 from . import __version__268 269- message = "Python %(python)s\n" "Flask %(flask)s\n" "Werkzeug %(werkzeug)s"269+ message = "Python %(python)s\nFlask %(flask)s\nWerkzeug %(werkzeug)s"270 click.echo(271 message272 % {273 "python": platform.python_version(),696 unmodified linesmodified:src/flask/ctx.py+4 added-3 removed
435 unmodified lines436 # Get rid of the app as well if necessary.437 if app_ctx is not None:438 app_ctx.pop(exc)439 440- assert (441- rv is self442- ), "Popped wrong request context. " "(%r instead of %r)" % (rv, self)440+ assert rv is self, "Popped wrong request context. (%r instead of %r)" % (441+ rv,442+ self,443+ )444 445 def auto_pop(self, exc):446 if self.request.environ.get("flask._preserve_context") or (447 exc is not None and self.app.preserve_context_on_exception28 unmodified linesmodified:src/flask/helpers.py+2 added-4 removed
92 unmodified lines93 def _endpoint_from_view_func(view_func):94 """Internal helper that returns the default endpoint for a given95 function. This always is the function name.96 """97- assert view_func is not None, "expected view func if endpoint " "is not provided."97+ assert view_func is not None, "expected view func if endpoint is not provided."98 return view_func.__name__99 100 101 def stream_with_context(generator_or_function):495 unmodified lines597 598 headers = Headers()599 if as_attachment:600 if attachment_filename is None:601- raise TypeError(602- "filename unavailable, required for " "sending as attachment"603- )601+ raise TypeError("filename unavailable, required for sending as attachment")602 603 if not isinstance(attachment_filename, text_type):604 attachment_filename = attachment_filename.decode("utf-8")605 516 unmodified linesmodified:src/flask/testing.py+2 added-2 removed
154 unmodified lines155 passed through.156 """157 if self.cookie_jar is None:158 raise RuntimeError(159- "Session transactions only make sense " "with cookies enabled."159+ "Session transactions only make sense with cookies enabled."160 )161 app = self.application162 environ_overrides = kwargs.setdefault("environ_overrides", {})163 self.cookie_jar.inject_wsgi(environ_overrides)2 unmodified lines166 session_interface = app.session_interface167 sess = session_interface.open_session(app, c.request)168 if sess is None:169 raise RuntimeError(170- "Session backend did not open a session. " "Check the configuration"170+ "Session backend did not open a session. Check the configuration"171 )172 173 # Since we have to open a new request context for the session174 # handling we want to make sure that we hide out own context109 unmodified linesmodified:tests/test_basic.py+1 added-1 removed
1724 unmodified lines1725 with client:1726 with pytest.raises(AssertionError) as e:1727 client.post("/foo", data={})1728 assert "http://localhost/foo/" in str(e)1729- assert ("Make sure to directly send " "your POST-request to this URL") in str(e)1729+ assert ("Make sure to directly send your POST-request to this URL") in str(e)1730 1731 rv = client.get("/foo", data={}, follow_redirects=True)1732 assert rv.data == b"success"1733 268 unmodified linesmodified:tests/test_config.py+3 added-3 removed
96 unmodified lines97 app = flask.Flask(__name__)98 app.config.from_envvar("FOO_SETTINGS")99 msg = str(e.value)100 assert msg.startswith(101- "[Errno 2] Unable to load configuration " "file (No such file or directory):"101+ "[Errno 2] Unable to load configuration file (No such file or directory):"102 )103 assert msg.endswith("missing.cfg'")104 assert not app.config.from_envvar("FOO_SETTINGS", silent=True)105 3 unmodified lines109 with pytest.raises(IOError) as e:110 app.config.from_pyfile("missing.cfg")111 msg = str(e.value)112 assert msg.startswith(113- "[Errno 2] Unable to load configuration " "file (No such file or directory):"113+ "[Errno 2] Unable to load configuration file (No such file or directory):"114 )115 assert msg.endswith("missing.cfg'")116 assert not app.config.from_pyfile("missing.cfg", silent=True)117 3 unmodified lines121 with pytest.raises(IOError) as e:122 app.config.from_json("missing.json")123 msg = str(e.value)124 assert msg.startswith(125- "[Errno 2] Unable to load configuration " "file (No such file or directory):"125+ "[Errno 2] Unable to load configuration file (No such file or directory):"126 )127 assert msg.endswith("missing.json'")128 assert not app.config.from_json("missing.json", silent=True)129 73 unmodified linesmodified:tests/test_instance_config.py+1 added-1 removed
67 unmodified lines68 def test_installed_module_paths(69 modules_tmpdir, modules_tmpdir_prefix, purge_module, site_packages, limit_loader70 ):71 site_packages.join("site_app.py").write(72- "import flask\n" "app = flask.Flask(__name__)\n"72+ "import flask\napp = flask.Flask(__name__)\n"73 )74 purge_module("site_app")75 76 from site_app import app67 unmodified linesmodified:tests/test_templating.py+1 added-1 removed
44 unmodified lines45 @app.context_processor46 def context_processor():47 return dict(foo=42)48 49- rv = flask.render_template_string("Hello {{ config.WORLD_NAME }} " "{{ foo }}")49+ rv = flask.render_template_string("Hello {{ config.WORLD_NAME }} {{ foo }}")50 assert rv == "Hello Special World 42"51 52 53 def test_standard_context(app, client):398 unmodified lines