| 364 | |
| 365 | @pytest.mark.parametrize("set_debug_flag", (True, False)) |
| 366 | def test_flaskgroup_debug(runner, set_debug_flag): |
| 367 | def create_app(): |
| 368 | app = Flask("flaskgroup") |
| 369 | app.debug = True |
| 370 | return app |
| 371 | |
| 372 | @click.group(cls=FlaskGroup, create_app=create_app, set_debug_flag=set_debug_flag) |
| 373 | def cli(**params): |
| 374 | pass |
| 375 | |
| 376 | @cli.command() |
| 377 | def test(): |
| 378 | click.echo(str(current_app.debug)) |
| 379 | |
| 380 | result = runner.invoke(cli, ["test"]) |
| 381 | assert result.exit_code == 0 |
| 382 | assert result.output == f"{not set_debug_flag}\n" |
| 383 | |
| 384 | |
| 385 | def test_flaskgroup_nested(app, runner): |