Commit 40a52051 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'p1' into 'master'

[click] Account for cases when exception is None in click results

See merge request !96
parents 06d3f361 beed7309
Pipeline #26014 passed with stages
in 9 minutes and 21 seconds
......@@ -395,9 +395,9 @@ def assert_click_runner_result(result, exit_code=0):
"""Helper for asserting click runner results"""
m = ("Click command exited with code `{}' and exception:\n{}"
"\nThe output was:\n{}")
m = m.format(
result.exit_code, ''.join(traceback.format_exception(*result.exc_info)),
result.output)
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment