fishy commented on code in PR #2816:
URL: https://github.com/apache/thrift/pull/2816#discussion_r1254779642
##########
test/py/TestClient.py:
##########
@@ -256,6 +256,26 @@ def testMultiException(self):
y = self.client.testMultiException('success', 'foobar')
self.assertEqual(y.string_thing, 'foobar')
+ def testException__traceback__(self):
+ print('testException__traceback__')
+ self.client.testException('Safe')
+ try:
+ self.client.testException('Xception')
+ self.fail("should have gotten exception")
+ except Xception as x:
+ uses_slots = hasattr(x, '__slots__')
+ try:
+ x.__traceback__ = x.__traceback__
+ self.assertTrue(
+ uses_slots,
+ 'expected editable exception to use slots, no slots
defined',
+ )
+ except Exception as e:
+ self.assertTrue(
+ isinstance(e, TypeError),
Review Comment:
or probably better split into 2 separated asserts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]