We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19e2206 commit 75a114cCopy full SHA for 75a114c
st2client/tests/base.py
@@ -109,6 +109,20 @@ def tearDown(self):
109
sys.stdout = sys.__stdout__
110
sys.stderr = sys.__stderr__
111
112
+ # On failure, we also print values of accumulated stdout and stderr
113
+ # to make troubleshooting easier
114
+ # TODO: nosetests specific make sure to update when / if switching to pytest
115
+ errors = getattr(self.__dict__.get("_outcome", None), "errors", [])
116
+
117
+ if len(errors) >= 1:
118
+ stdout = self.stdout.getvalue()
119
+ stderr = self.stderr.getvalue()
120
121
+ print("")
122
+ print("Captured stdout: %s" % (stdout))
123
+ print("Captured stdoerr: %s" % (stderr))
124
125
126
def _reset_output_streams(self):
127
"""
128
Reset / clear stdout and stderr stream.
0 commit comments