forked from orbit-oss/flask
Merge pull request #3236 from lordmauve/no-cligroup-empty
Do not register empty CLI groups from Blueprint
This commit is contained in:
commit
91e53da054
2 changed files with 12 additions and 0 deletions
|
|
@ -652,3 +652,12 @@ def test_cli_blueprints(app):
|
|||
|
||||
result = app_runner.invoke(args=["late_registration", "late"])
|
||||
assert "late_result" in result.output
|
||||
|
||||
|
||||
def test_cli_empty(app):
|
||||
"""If a Blueprint's CLI group is empty, do not register it."""
|
||||
bp = Blueprint("blue", __name__, cli_group="blue")
|
||||
app.register_blueprint(bp)
|
||||
|
||||
result = app.test_cli_runner().invoke(args=["blue", "--help"])
|
||||
assert result.exit_code == 2, "Unexpected success:\n\n" + result.output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue