This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/teal/cli.py
Cayo Puigdefabregas 01ef359bd4 add teal as module
2023-03-21 12:08:13 +01:00

14 lines
422 B
Python

from flask.testing import FlaskCliRunner
class TealCliRunner(FlaskCliRunner):
"""The same as FlaskCliRunner but with invoke's
'catch_exceptions' as False.
"""
def invoke(self, *args, cli=None, **kwargs):
kwargs.setdefault('catch_exceptions', False)
r = super().invoke(cli, args, **kwargs)
assert r.exit_code == 0, 'CLI code {}: {}'.format(r.exit_code, r.output)
return r