summaryrefslogtreecommitdiff
path: root/tests/testutils/runcli.py
diff options
context:
space:
mode:
authorJosh Smith <qinusty@gmail.com>2018-08-29 11:54:47 +0100
committerJosh Smith <qinusty@gmail.com>2018-08-29 17:13:35 +0100
commit26b7c50c860489c1852d5c8dc82a448b1d9aeb97 (patch)
tree1d3ab51e55dc3ae1e151c2ae82a3e85683f71222 /tests/testutils/runcli.py
parent2992a6755270939cd5fedaf92493ae4b4884dc09 (diff)
downloadbuildstream-Qinusty/600-recursive-variables.tar.gz
Add tests for cyclic variables checkQinusty/600-recursive-variables
Note: This modifies the docker containers used for testing to supply the pytest-timeout package.
Diffstat (limited to 'tests/testutils/runcli.py')
-rw-r--r--tests/testutils/runcli.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index ee4eb957e..8cd5bcb75 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -94,14 +94,28 @@ class Result():
# error_reason (any): The reason field of the error which occurred
# fail_message (str): An optional message to override the automatic
# assertion error messages
+ # debug (bool): If true, prints information regarding the exit state of the result()
# Raises:
# (AssertionError): If any of the assertions fail
#
def assert_main_error(self,
error_domain,
error_reason,
- fail_message=''):
-
+ fail_message='',
+ *, debug=False):
+ if debug:
+ print(
+ """
+ Exit code: {}
+ Exception: {}
+ Domain: {}
+ Reason: {}
+ """.format(
+ self.exit_code,
+ self.exception,
+ self.exception.domain,
+ self.exception.reason
+ ))
assert self.exit_code == -1, fail_message
assert self.exc is not None, fail_message
assert self.exception is not None, fail_message