Skip to content
Snippets Groups Projects
Commit ab8fb5be authored by Nathaniel Manista's avatar Nathaniel Manista Committed by GitHub
Browse files

Merge pull request #9156 from nathanielmanistaatgoogle/Exception.message

Drop use of Exception.message in metadata test.
parents 7d30bb20 6aedd44f
No related branches found
No related tags found
No related merge requests found
......@@ -83,8 +83,7 @@ class InvalidMetadataTest(unittest.TestCase):
expected_error_details = "metadata was invalid: %s" % metadata
with self.assertRaises(ValueError) as exception_context:
self._unary_unary(request, metadata=metadata)
self.assertEqual(
expected_error_details, exception_context.exception.message)
self.assertIn(expected_error_details, str(exception_context.exception))
def testUnaryRequestBlockingUnaryResponseWithCall(self):
request = b'\x07\x08'
......@@ -92,8 +91,7 @@ class InvalidMetadataTest(unittest.TestCase):
expected_error_details = "metadata was invalid: %s" % metadata
with self.assertRaises(ValueError) as exception_context:
self._unary_unary.with_call(request, metadata=metadata)
self.assertEqual(
expected_error_details, exception_context.exception.message)
self.assertIn(expected_error_details, str(exception_context.exception))
def testUnaryRequestFutureUnaryResponse(self):
request = b'\x07\x08'
......@@ -129,8 +127,7 @@ class InvalidMetadataTest(unittest.TestCase):
expected_error_details = "metadata was invalid: %s" % metadata
with self.assertRaises(ValueError) as exception_context:
self._stream_unary(request_iterator, metadata=metadata)
self.assertEqual(
expected_error_details, exception_context.exception.message)
self.assertIn(expected_error_details, str(exception_context.exception))
def testStreamRequestBlockingUnaryResponseWithCall(self):
request_iterator = (
......@@ -140,8 +137,7 @@ class InvalidMetadataTest(unittest.TestCase):
multi_callable = _stream_unary_multi_callable(self._channel)
with self.assertRaises(ValueError) as exception_context:
multi_callable.with_call(request_iterator, metadata=metadata)
self.assertEqual(
expected_error_details, exception_context.exception.message)
self.assertIn(expected_error_details, str(exception_context.exception))
def testStreamRequestFutureUnaryResponse(self):
request_iterator = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment