Skip to content
Myr

fix flake8 bugbear errors

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 8f13f5b · Browse files · 3 files+17 added−16 removed
This commit

State

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

Diff stats

3 files+17 added−16 removed

  • tests:+5 added−5 removed
  • other:+12 added−11 removed

3 files+17 added−16 removed

modified:tests/test_appctx.py+3 added-3 removed
118 unmodified lines
119 cleanup_stuff.append(exception)120121 @app.route("/")122 def index():123 raise Exception("dummy")123 raise ValueError("dummy")124125 with pytest.raises(Exception, match="dummy"):125 with pytest.raises(ValueError, match="dummy"):126 with app.app_context():127 client.get("/")128129 assert len(cleanup_stuff) == 1130 assert isinstance(cleanup_stuff[0], Exception)130 assert isinstance(cleanup_stuff[0], ValueError)131 assert str(cleanup_stuff[0]) == "dummy"132133134def test_app_ctx_globals_methods(app, app_ctx):
78 unmodified lines
modified:tests/test_basic.py+2 added-2 removed
1470 unmodified lines
1471 with app.test_request_context():1472 rv = flask.url_for("static", filename="index.html", _external=True)1473 assert rv == "http://example.com/static/index.html"1474 # Providing static_host without host_matching=True should error.1475 with pytest.raises(Exception):1475 with pytest.raises(AssertionError):1476 flask.Flask(__name__, static_host="example.com")1477 # Providing host_matching=True with static_folder1478 # but without static_host should error.1479 with pytest.raises(Exception):1479 with pytest.raises(AssertionError):1480 flask.Flask(__name__, host_matching=True)1481 # Providing host_matching=True without static_host1482 # but with static_folder=None should not error.1483 flask.Flask(__name__, host_matching=True, static_folder=None)
475 unmodified lines
modified:.flake8+12 added-11 removed
1[flake8]2# B = bugbear3# E = pycodestyle errors4# F = flake8 pyflakes5# W = pycodestyle warnings6# B9 = bugbear opinions7# ISC = implicit str concat8select = B, E, F, W, B9, ISC9ignore =2extend-select =3 # bugbear4 B5 # bugbear opinions6 B97 # implicit str concat8 ISC9extend-ignore =10 # slice notation whitespace, invalid11 E20312 # import at top, too many circular import fixes13 E40214 # line length, handled by bugbear B95015 E50116 # bare except, handled by bugbear B00117 E72218 # bin op line break, invalid19 W50320 # requires Python 3.1018 # zip with strict=, requires python >= 3.1019 B90520 # string formatting opinion, B028 renamed to B90721 B02822 B90723# up to 88 allowed by bugbear B95024max-line-length = 8025per-file-ignores =26 # __init__ exports names
1 unmodified line