From 4faec5e01ad1d39d0fb7cab47a96f196b3c5685b Mon Sep 17 00:00:00 2001 From: Lawrence D'Anna Date: Thu, 10 Oct 2019 18:38:23 +0000 Subject: 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 --- .../Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/python_api') diff --git a/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py b/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py index 876a149eada..5bd72e81015 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/file_handle/TestFileHandle.py @@ -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']) -- cgit v1.2.3