summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/test/breakpoint_command/TestBreakpointCommand.py7
-rw-r--r--lldb/test/settings/TestSettings.py3
2 files changed, 6 insertions, 4 deletions
diff --git a/lldb/test/breakpoint_command/TestBreakpointCommand.py b/lldb/test/breakpoint_command/TestBreakpointCommand.py
index d9e2ec67a80..f3a35807ebf 100644
--- a/lldb/test/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/test/breakpoint_command/TestBreakpointCommand.py
@@ -65,10 +65,11 @@ class BreakpointCommandTestCase(TestBase):
# Check that the file 'output.txt' exists and contains the string "lldb".
# Read the output file produced by running the program.
- output = open('output.txt', 'r').read()
+ with open('output.txt', 'r') as f:
+ output = f.read()
- self.assertTrue(output.startswith("lldb"),
- "File 'output.txt' and the content matches")
+ self.expect(output, "File 'output.txt' and the content matches", exe=False,
+ startstr = "lldb")
# Finish the program.
self.runCmd("process continue")
diff --git a/lldb/test/settings/TestSettings.py b/lldb/test/settings/TestSettings.py
index b15f7a59927..eb072135ce2 100644
--- a/lldb/test/settings/TestSettings.py
+++ b/lldb/test/settings/TestSettings.py
@@ -70,7 +70,8 @@ class SettingsCommandTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
# Read the output file produced by running the program.
- output = open('output.txt', 'r').read()
+ with open('output.txt', 'r') as f:
+ output = f.read()
self.expect(output, exe=False,
substrs = ["argv[1] matches",
OpenPOWER on IntegriCloud