[Lldb-commits] [lldb] 956df6f - [lldb] Improve assert message in TestCPPAccelerator

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 20 03:04:53 PDT 2021


Author: Raphael Isemann
Date: 2021-10-20T12:04:28+02:00
New Revision: 956df6fa620a0ca75fd6e62b5318fb4d14304a4f

URL: https://github.com/llvm/llvm-project/commit/956df6fa620a0ca75fd6e62b5318fb4d14304a4f
DIFF: https://github.com/llvm/llvm-project/commit/956df6fa620a0ca75fd6e62b5318fb4d14304a4f.diff

LOG: [lldb] Improve assert message in TestCPPAccelerator

`log` is just some IO object that gets printed as `<_io.TextIOWrapper = filename`
but the intention here was to print the actual found log contents.

Added: 
    

Modified: 
    lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py b/lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
index 3600de758ff3..83499d8f95f6 100644
--- a/lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
+++ b/lldb/test/API/lang/cpp/accelerator-table/TestCPPAccelerator.py
@@ -23,11 +23,12 @@ def test(self):
         # of it not being in the first file looked at.
         self.expect('frame variable inner_d')
 
-        log = open(logfile, 'r')
+        with open(logfile) as f:
+            log = f.readlines()
         n = 0
         for line in log:
             if re.findall(r'[abcdefg]\.o: FindByNameAndTag\(\)', line):
                 self.assertIn("d.o", line)
                 n += 1
 
-        self.assertEqual(n, 1, log)
+        self.assertEqual(n, 1, "".join(log))


        


More information about the lldb-commits mailing list