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

llvm-svn: 374417
This commit is contained in:
Lawrence D'Anna 2019-10-10 18:38:23 +00:00
parent 63bb6737ce
commit 4faec5e01a
1 changed files with 2 additions and 2 deletions

View File

@ -676,11 +676,11 @@ class FileHandleTestCase(lldbtest.TestBase):
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'])