Fix blueprint self registration

By raising a ValueError if attempted. I don't see a use case that
makes this worth supporting.
This commit is contained in:
pgjones 2021-05-21 15:01:32 +01:00
parent 9409be6e34
commit 714b0a467a
2 changed files with 8 additions and 0 deletions

View file

@ -883,3 +883,9 @@ def test_unique_blueprint_names(app, client) -> None:
app.register_blueprint(bp2) # different bp, same name, error
app.register_blueprint(bp2, name="alt") # different bp, different name, ok
def test_self_registration(app, client) -> None:
bp = flask.Blueprint("bp", __name__)
with pytest.raises(ValueError):
bp.register_blueprint(bp)