[Lldb-commits] [lldb] r374417 - TestFileHandle.py: fix for Python 3.6
Lawrence D'Anna via lldb-commits
lldb-commits at lists.llvm.org
Thu Oct 10 11:38:23 PDT 2019
Author: lawrence_danna
Date: Thu Oct 10 11:38:23 2019
New Revision: 374417
URL: http://llvm.org/viewvc/llvm-project?rev=374417&view=rev
Log:
TestFileHandle.py: fix for Python 3.6
Summary:
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.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68745
Modified:
lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
Modified: lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py?rev=374417&r1=374416&r2=374417&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py Thu Oct 10 11:38:23 2019
@@ -676,11 +676,11 @@ class FileHandleTestCase(lldbtest.TestBa
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'])
More information about the lldb-commits
mailing list