Merge pull request #3236 from lordmauve/no-cligroup-empty

Do not register empty CLI groups from Blueprint
This commit is contained in:
David Lord 2019-05-31 13:05:00 -04:00 committed by GitHub
commit 91e53da054
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -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