forked from OSchip/llvm-project
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
This commit is contained in:
parent
e6acf35582
commit
277c8f0f1d
|
@ -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")
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue