Skip to content
Myr

Add test to showcase that printing a traceback works

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sven-Hendrik Haase · committed by Sven-Hendrik Haase · parent ad42d88 · Browse files · 1 file+17 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+17 added−0 removed

  • tests:+17 added−0 removed

1 file+17 added−0 removed

modified:tests/test_cli.py+17 added
189 unmodified lines
190 runner = CliRunner()191 result = runner.invoke(cli, ['test'])192 assert result.exit_code == 0193 assert result.output == 'flaskgroup\n'194195196def test_print_exceptions():197 """Print the stacktrace if the CLI."""198 def create_app(info):199 raise Exception("oh no")200 return Flask("flaskgroup")201202 @click.group(cls=FlaskGroup, create_app=create_app)203 def cli(**params):204 pass205206 runner = CliRunner()207 result = runner.invoke(cli, ['--help'])208 assert result.exit_code == 0209 assert 'Exception: oh no' in result.output210 assert 'Traceback' in result.output