summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/format/__init__.py0
-rw-r--r--tests/testutils/runcli.py15
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/format/__init__.py b/tests/format/__init__.py
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/format/__init__.py
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index 86cc8f71c..963af2fe5 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -9,6 +9,19 @@ import pytest
from buildstream._frontend.main import cli as bst_cli
from buildstream import _yaml
+# Special private exception accessor, for test case purposes
+from buildstream.exceptions import _get_last_exception
+
+
+# Wrapper for the click.testing result
+class Result():
+
+ def __init__(self, result):
+ self.exit_code = result.exit_code
+ self.output = result.output
+ self.exception = _get_last_exception()
+ self.result = result
+
class Cli():
@@ -87,7 +100,7 @@ class Cli():
if result.exc_info and result.exc_info[0] != SystemExit:
traceback.print_exception(*result.exc_info)
- return result
+ return Result(result)
# Fetch an element state by name by
# invoking bst show on the project with the CLI