aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/internal/unknown_fields_test.py
diff options
context:
space:
mode:
authorDan O'Reilly <oreilldf@gmail.com>2015-08-14 22:54:53 -0400
committerDan O'Reilly <oreilldf@gmail.com>2015-08-14 22:54:53 -0400
commit2621c8aefbfefd517a3facc6dc0e0dc45ae5eb87 (patch)
treea12a81028a9ac3b4aab2cfbbfc495e1da82c5669 /python/google/protobuf/internal/unknown_fields_test.py
parentd06adbd4a48c83aa8e9085e988020ad3bff43211 (diff)
downloadprotobuf-2621c8aefbfefd517a3facc6dc0e0dc45ae5eb87.tar.gz
protobuf-2621c8aefbfefd517a3facc6dc0e0dc45ae5eb87.tar.bz2
protobuf-2621c8aefbfefd517a3facc6dc0e0dc45ae5eb87.zip
Get Python 2.6 working.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
Diffstat (limited to 'python/google/protobuf/internal/unknown_fields_test.py')
-rwxr-xr-xpython/google/protobuf/internal/unknown_fields_test.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/python/google/protobuf/internal/unknown_fields_test.py b/python/google/protobuf/internal/unknown_fields_test.py
index 5cd23d78..1b5d7bc0 100755
--- a/python/google/protobuf/internal/unknown_fields_test.py
+++ b/python/google/protobuf/internal/unknown_fields_test.py
@@ -35,18 +35,10 @@
__author__ = 'bohdank@google.com (Bohdan Koval)'
-import unittest
try:
- from unittest import skipIf
+ import unittest2 as unittest
except ImportError:
- def skipIf(predicate, message):
- def decorator(wrapped):
- if predicate:
- def _noop(*args, **kw):
- pass
- return _noop
- return wrapped
- return decorator
+ import unittest
from google.protobuf import unittest_mset_pb2
from google.protobuf import unittest_pb2
@@ -129,7 +121,7 @@ class UnknownFieldsTest(unittest.TestCase):
self.assertNotEqual(self.empty_message, message)
-@skipIf(
+@unittest.skipIf(
api_implementation.Type() == 'cpp' and api_implementation.Version() == 2,
'C++ implementation does not expose unknown fields to Python')
class UnknownFieldsAccessorsTest(unittest.TestCase):
@@ -217,7 +209,7 @@ class UnknownFieldsAccessorsTest(unittest.TestCase):
-@skipIf(
+@unittest.skipIf(
api_implementation.Type() == 'cpp' and api_implementation.Version() == 2,
'C++ implementation does not expose unknown fields to Python')
class UnknownEnumValuesTest(unittest.TestCase):