Merge pull request #3229 from lordmauve/style-fix
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Fix style issues on master using Black
authored by David Lord · committed by GitHub · parents 2c68f86, a5ff3cd · Browse files · 4 files·+19 added−14 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
4 files+19 added−14 removed
- tests:+14 added−11 removed
- other:+5 added−3 removed
Provenance
- Commit
240e398- Tree
383cb44- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
2c68f86- Parent 2
a5ff3cd
4 files changed+19 added−14 removed
modified:flask/cli.py+5 added-3 removed
658 unmodified lines659 click.echo(" * Environment: {0}".format(env))660 661 if env == "production":662 click.secho(663- ' WARNING: This is a development server. '664- 'Do not use it in a production deployment.', fg='red')665- click.secho(' Use a production WSGI server instead.', dim=True)663+ " WARNING: This is a development server. "664+ "Do not use it in a production deployment.",665+ fg="red",666+ )667+ click.secho(" Use a production WSGI server instead.", dim=True)668 669 if debug is not None:670 click.echo(" * Debug mode: {0}".format("on" if debug else "off"))671 279 unmodified linesmodified:tests/test_basic.py+13 added-9 removed
1145 unmodified lines1146 @app.route("/wsgi")1147 def from_wsgi():1148 return NotFound()1149 1150- @app.route('/dict')1150+ @app.route("/dict")1151 def from_dict():1152 return {"foo": "bar"}, 2011153 1154- assert client.get('/text').data == u'Hällo Wörld'.encode('utf-8')1155- assert client.get('/bytes').data == u'Hällo Wörld'.encode('utf-8')1154+ assert client.get("/text").data == u"Hällo Wörld".encode("utf-8")1155+ assert client.get("/bytes").data == u"Hällo Wörld".encode("utf-8")1156 1157 rv = client.get("/full_tuple")1158 assert rv.data == b"Meh"1159 assert rv.headers["X-Foo"] == "Testing"24 unmodified lines1184 rv = client.get("/wsgi")1185 assert b"Not Found" in rv.data1186 assert rv.status_code == 4041187 1188- rv = client.get('/dict')1188+ rv = client.get("/dict")1189 assert rv.json == {"foo": "bar"}1190 assert rv.status_code == 2011191 1192 107 unmodified lines1300 1301 @pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")1302 def test_json_dump_dataclass(app, req_ctx):1303 from dataclasses import make_dataclass1304+1305 Data = make_dataclass("Data", [("name", str)])1306 value = flask.json.dumps(Data("Flask"), app=app)1307 value = flask.json.loads(value, app=app)1308 assert value == {"name": "Flask"}1309 1310+1311 def test_jsonify_args_and_kwargs_check(app, req_ctx):1312 with pytest.raises(TypeError) as e:1313 flask.jsonify("fake args", kwargs="fake")1314 assert "behavior undefined" in str(e.value)114 unmodified lines1429 assert flask.url_for("static", filename="index.html") == "/foo/index.html"1430 1431 1432 def test_static_url_empty_path(app):1431- app = flask.Flask(__name__, static_folder='', static_url_path='')1432- rv = app.test_client().open('/static/index.html', method='GET')1433+ app = flask.Flask(__name__, static_folder="", static_url_path="")1434+ rv = app.test_client().open("/static/index.html", method="GET")1435 assert rv.status_code == 2001436 rv.close()1437 1438 1439 def test_static_url_empty_path_default(app):1438- app = flask.Flask(__name__, static_folder='')1439- rv = app.test_client().open('/static/index.html', method='GET')1440+ app = flask.Flask(__name__, static_folder="")1441+ rv = app.test_client().open("/static/index.html", method="GET")1442 assert rv.status_code == 2001443 rv.close()1444 1445 504 unmodified lines1950 (None, None, "localhost:8080", "localhost", 8080),1951 (None, None, "localhost:0", "localhost", 0),1952 ),1953 )1952-def test_run_from_config(monkeypatch, host, port, server_name, expect_host, expect_port, app):1954+def test_run_from_config(1955+ monkeypatch, host, port, server_name, expect_host, expect_port, app1956+):1957 def run_simple_mock(hostname, port, *args, **kwargs):1958 assert hostname == expect_host1959 assert port == expect_port1960 33 unmodified linesmodified:tests/test_cli.py+1 added-1 removed
523 unmodified lines524 # set manually, files don't overwrite525 assert os.environ["EGGS"] == "3"526 527 # Non existent file should not load528- assert not load_dotenv('non-existent-file')528+ assert not load_dotenv("non-existent-file")529 530 531 @need_dotenv532 def test_dotenv_path(monkeypatch):122 unmodified linesmodified:tests/test_helpers.py-1 removed
974 unmodified lines975 with pytest.raises(NotFound):976 print(flask.safe_join(*args))977 978 979-979 class TestHelpers(object):980 @pytest.mark.parametrize(981 "debug, expected_flag, expected_default_flag",982 [56 unmodified lines