Skip to content
Myr

Fix style issues on master using Black

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Pope · committed by Daniel Pope · parent 2c68f86 · 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

4 files+19 added−14 removed

modified:flask/cli.py+5 added-3 removed
658 unmodified lines
659 click.echo(" * Environment: {0}".format(env))660661 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)668669 if debug is not None:670 click.echo(" * Debug mode: {0}".format("on" if debug else "off"))671
279 unmodified lines
modified:tests/test_basic.py+13 added-9 removed
1145 unmodified lines
1146 @app.route("/wsgi")1147 def from_wsgi():1148 return NotFound()11491150 @app.route('/dict')1150 @app.route("/dict")1151 def from_dict():1152 return {"foo": "bar"}, 20111531154 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")11561157 rv = client.get("/full_tuple")1158 assert rv.data == b"Meh"1159 assert rv.headers["X-Foo"] == "Testing"
24 unmodified lines
1184 rv = client.get("/wsgi")1185 assert b"Not Found" in rv.data1186 assert rv.status_code == 40411871188 rv = client.get('/dict')1188 rv = client.get("/dict")1189 assert rv.json == {"foo": "bar"}1190 assert rv.status_code == 20111911192
107 unmodified lines
13001301@pytest.mark.skipif(sys.version_info < (3, 7), reason="requires Python >= 3.7")1302def test_json_dump_dataclass(app, req_ctx):1303 from dataclasses import make_dataclass13041305 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"}130913101311def 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 lines
1429 assert flask.url_for("static", filename="index.html") == "/foo/index.html"143014311432def 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()143714381439def 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()14441445
504 unmodified lines
1950 (None, None, "localhost:8080", "localhost", 8080),1951 (None, None, "localhost:0", "localhost", 0),1952 ),1953)1952def test_run_from_config(monkeypatch, host, port, server_name, expect_host, expect_port, app):1954def 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 lines
modified:tests/test_cli.py+1 added-1 removed
523 unmodified lines
524 # set manually, files don't overwrite525 assert os.environ["EGGS"] == "3"526527 # Non existent file should not load528 assert not load_dotenv('non-existent-file')528 assert not load_dotenv("non-existent-file")529530531@need_dotenv532def test_dotenv_path(monkeypatch):
122 unmodified lines
modified:tests/test_helpers.py-1 removed
974 unmodified lines
975 with pytest.raises(NotFound):976 print(flask.safe_join(*args))977978979979class TestHelpers(object):980 @pytest.mark.parametrize(981 "debug, expected_flag, expected_default_flag",982 [
56 unmodified lines