Wrap the rest of file reading operations inside a with block and convert a assertTrue()
usage to self.expect() which is more descriptive.
llvm-svn: 116115
diff --git a/lldb/test/breakpoint_command/TestBreakpointCommand.py b/lldb/test/breakpoint_command/TestBreakpointCommand.py
index d9e2ec6..f3a3580 100644
--- a/lldb/test/breakpoint_command/TestBreakpointCommand.py
+++ b/lldb/test/breakpoint_command/TestBreakpointCommand.py
@@ -65,10 +65,11 @@
# 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")