MCPcopy
hub / github.com/pallets/flask / test_flaskgroup_debug

Function test_flaskgroup_debug

tests/test_cli.py:366–382  ·  view source on GitHub ↗
(runner, set_debug_flag)

Source from the content-addressed store, hash-verified

364
365@pytest.mark.parametrize("set_debug_flag", (True, False))
366def 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
385def test_flaskgroup_nested(app, runner):

Callers

nothing calls this directly

Calls 1

invokeMethod · 0.45

Tested by

no test coverage detected