aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/internal/reflection_test.py
diff options
context:
space:
mode:
authorGravatar Tamir Duberstein <tamird@gmail.com>2015-08-12 14:22:25 -0400
committerGravatar Tamir Duberstein <tamird@gmail.com>2015-08-22 12:56:34 -0400
commit821fcb2ded668a688316b66fcd5ff28e868298e7 (patch)
treea8777f6575bf72dd4a86d1e2be000c61aa3e5655 /python/google/protobuf/internal/reflection_test.py
parent09831c87685519908248cb306111b7bab71c1962 (diff)
Use assertIsInstance
Diffstat (limited to 'python/google/protobuf/internal/reflection_test.py')
-rwxr-xr-xpython/google/protobuf/internal/reflection_test.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/google/protobuf/internal/reflection_test.py b/python/google/protobuf/internal/reflection_test.py
index 1a162272..5d691bcf 100755
--- a/python/google/protobuf/internal/reflection_test.py
+++ b/python/google/protobuf/internal/reflection_test.py
@@ -614,10 +614,10 @@ class ReflectionTest(unittest.TestCase):
def TestGetAndDeserialize(field_name, value, expected_type):
proto = unittest_pb2.TestAllTypes()
setattr(proto, field_name, value)
- self.assertTrue(isinstance(getattr(proto, field_name), expected_type))
+ self.assertIsInstance(getattr(proto, field_name), expected_type)
proto2 = unittest_pb2.TestAllTypes()
proto2.ParseFromString(proto.SerializeToString())
- self.assertTrue(isinstance(getattr(proto2, field_name), expected_type))
+ self.assertIsInstance(getattr(proto2, field_name), expected_type)
TestGetAndDeserialize('optional_int32', 1, int)
TestGetAndDeserialize('optional_int32', 1 << 30, int)
@@ -903,7 +903,7 @@ class ReflectionTest(unittest.TestCase):
self.assertTrue(proto.repeated_nested_message)
self.assertEqual(2, len(proto.repeated_nested_message))
self.assertListsEqual([m0, m1], proto.repeated_nested_message)
- self.assertTrue(isinstance(m0, unittest_pb2.TestAllTypes.NestedMessage))
+ self.assertIsInstance(m0, unittest_pb2.TestAllTypes.NestedMessage)
# Test out-of-bounds indices.
self.assertRaises(IndexError, proto.repeated_nested_message.__getitem__,