]> granicus.if.org Git - python/commitdiff
Restored test_xpickle compatibility with Python 2.5.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 31 Jan 2015 07:25:16 +0000 (09:25 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 31 Jan 2015 07:25:16 +0000 (09:25 +0200)
Python 2.5 has no unittest.skipUnless.

Lib/test/test_xpickle.py

index b6973f62f7fae7d7350c322b2ca06a139d9a59d5..95ad4eba77fa6d129986bc68d7278b44cf8bac37 100644 (file)
@@ -158,8 +158,10 @@ class AbstractCompatTests(AbstractPickleTests):
 
     # This is a cut-down version of pickletester's test_unicode. Backwards
     # compatibility was explicitly broken in r67934 to fix a bug.
-    @unittest.skipUnless(test_support.have_unicode, 'no unicode support')
     def test_unicode(self):
+        if not test_support.have_unicode:
+            # Python 2.5 has no unittest.skipUnless
+            self.skipTest('no unicode support')
         endcases = [u'', u'<\\u>', u'<\\%c>' % 0x1234, u'<\n>', u'<\\>']
         for proto in pickletester.protocols:
             for u in endcases:
@@ -218,7 +220,7 @@ class CPicklePython27Compat(AbstractCompatTests):
     python = "python2.7"
     error = cPickle.BadPickleGet
 
-class PicklePython27Compat(CPicklePython26Compat):
+class PicklePython27Compat(CPicklePython27Compat):
 
     module = pickle
     error = KeyError