[Lldb-commits] [PATCH] D68745: TestFileHandle.py: fix for Python 3.6
Lawrence D'Anna via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 9 16:49:24 PDT 2019
lawrence_danna created this revision.
lawrence_danna added reviewers: JDevlieghere, jasonmolenda, labath.
Herald added a project: LLDB.
Python 3.6 stringifies exceptions as `ExceptionClass("foo",)` instead
of `ExceptionClass("foo")`. This patch makes the test assertions a
little more flexible so the test passes anyway.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D68745
Files:
lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
Index: lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
+++ lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
@@ -668,11 +668,11 @@
error, n = lldb.SBFile(BadIO()).Write(b"FOO")
self.assertEqual(n, 0)
self.assertTrue(error.Fail())
- self.assertEqual(error.GetCString(), "OhNoe('OH NOE')")
+ self.assertIn('OH NOE', error.GetCString())
error, n = lldb.SBFile(BadIO()).Read(bytearray(100))
self.assertEqual(n, 0)
self.assertTrue(error.Fail())
- self.assertEqual(error.GetCString(), "OhNoe('OH NOE')")
+ self.assertIn('OH NOE', error.GetCString())
@add_test_categories(['pyapi'])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68745.224206.patch
Type: text/x-patch
Size: 912 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191009/2fe7d282/attachment.bin>
More information about the lldb-commits
mailing list