|
@@ -41,7 +41,10 @@ import operator
|
|
|
import six
|
|
|
import struct
|
|
|
|
|
|
-import unittest
|
|
|
+try:
|
|
|
+ import unittest2 as unittest
|
|
|
+except ImportError:
|
|
|
+ import unittest
|
|
|
from google.protobuf import unittest_import_pb2
|
|
|
from google.protobuf import unittest_mset_pb2
|
|
|
from google.protobuf import unittest_pb2
|
|
@@ -1623,7 +1626,7 @@ class ReflectionTest(unittest.TestCase):
|
|
|
self.assertFalse(proto.IsInitialized(errors))
|
|
|
self.assertEqual(errors, ['a', 'b', 'c'])
|
|
|
|
|
|
- @test_util.skipIf(
|
|
|
+ @unittest.skipIf(
|
|
|
api_implementation.Type() != 'cpp' or api_implementation.Version() != 2,
|
|
|
'Errors are only available from the most recent C++ implementation.')
|
|
|
def testFileDescriptorErrors(self):
|
|
@@ -2822,7 +2825,7 @@ class OptionsTest(unittest.TestCase):
|
|
|
|
|
|
class ClassAPITest(unittest.TestCase):
|
|
|
|
|
|
- @test_util.skipIf(
|
|
|
+ @unittest.skipIf(
|
|
|
api_implementation.Type() == 'cpp' and api_implementation.Version() == 2,
|
|
|
'C++ implementation requires a call to MakeDescriptor()')
|
|
|
def testMakeClassWithNestedDescriptor(self):
|