f-strings everywhere

This commit is contained in:
David Lord 2020-04-04 11:39:03 -07:00
parent 524fd0bc8c
commit 2ae740dd49
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
35 changed files with 227 additions and 245 deletions

View file

@ -28,7 +28,7 @@ def common_object_test(app):
def test_config_from_pyfile():
app = flask.Flask(__name__)
app.config.from_pyfile(__file__.rsplit(".", 1)[0] + ".py")
app.config.from_pyfile(f"{__file__.rsplit('.', 1)[0]}.py")
common_object_test(app)
@ -84,7 +84,7 @@ def test_config_from_envvar(monkeypatch):
assert not app.config.from_envvar("FOO_SETTINGS", silent=True)
monkeypatch.setattr(
"os.environ", {"FOO_SETTINGS": __file__.rsplit(".", 1)[0] + ".py"}
"os.environ", {"FOO_SETTINGS": f"{__file__.rsplit('.', 1)[0]}.py"}
)
assert app.config.from_envvar("FOO_SETTINGS")
common_object_test(app)
@ -185,12 +185,10 @@ def test_from_pyfile_weird_encoding(tmpdir, encoding):
f = tmpdir.join("my_config.py")
f.write_binary(
textwrap.dedent(
f"""
# -*- coding: {encoding} -*-
TEST_VALUE = "föö"
"""
# -*- coding: {} -*-
TEST_VALUE = "föö"
""".format(
encoding
)
).encode(encoding)
)
app = flask.Flask(__name__)