Add a HideStdout() method to our TestBase class and call it from TestAbbreviations.py
and TestAliases.py. Pass the keyword argument 'check=False' to:
self.runCmd("script my.date()", check=False)
since we want to restore sys.stdout no matter what the outcome of the runCmd is.
llvm-svn: 129949
diff --git a/lldb/test/command_source/TestCommandSource.py b/lldb/test/command_source/TestCommandSource.py
index bd4493f..4c8404a 100644
--- a/lldb/test/command_source/TestCommandSource.py
+++ b/lldb/test/command_source/TestCommandSource.py
@@ -27,7 +27,8 @@
sys.stdout = session
# Python should evaluate "my.date()" successfully.
- self.runCmd("script my.date()")
+ # Pass 'check=False' so that sys.stdout gets restored unconditionally.
+ self.runCmd("script my.date()", check=False)
# Now restore stdout to the way we were. :-)
sys.stdout = old_stdout