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:
parent
9409be6e34
commit
714b0a467a
2 changed files with 8 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue