Skip to content
Snippets Groups Projects
Commit 7aa3f447 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

Merge branch 'revert-6ab0b663' into 'master'

Revert "Merge branch 'assert_click_runner_result' into 'master'"

See merge request bob/exposed!5
parents 6ab0b663 e83aef31
Branches
Tags
1 merge request!5Revert "Merge branch 'assert_click_runner_result' into 'master'"
Pipeline #66547 passed
......@@ -8,7 +8,6 @@ import logging
import pprint
import shutil
import time
import traceback
import typing
from importlib.metadata import EntryPoint
......@@ -869,22 +868,3 @@ def config_group(
return group_wrapper
return group_decorator
def assert_click_runner_result(result, exit_code=0, exception_type=None):
"""Helper for asserting click runner results."""
m = (
"Click command exited with code `{}' and exception:\n{}"
"\nThe output was:\n{}"
)
exception = (
"None"
if result.exc_info is None
else "".join(traceback.format_exception(*result.exc_info))
)
m = m.format(result.exit_code, exception, result.output)
assert result.exit_code == exit_code, m
if exit_code == 0:
assert not result.exception, m
if exception_type is not None:
assert isinstance(result.exception, exception_type), m
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment