Add __bool__ as well as __nonzero__ for python3

This commit is contained in:
Jie Luo 2017-07-24 16:42:23 -07:00 committed by GitHub
parent a484794820
commit 9c012ed07d

View File

@ -166,6 +166,9 @@ class MessageTest(BaseTestCase):
def __nonzero__(self):
raise BadArgError()
def __bool__(self):
raise BadArgError()
with self.assertRaises(BadArgError):
golden_message.SerializeToString(deterministic=BadArg())