]> granicus.if.org Git - python/commitdiff
Issue #24164: Fixed test_descr: __getnewargs_ex__ now is supported in protocols 2...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 11 Oct 2015 14:52:09 +0000 (17:52 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 11 Oct 2015 14:52:09 +0000 (17:52 +0300)
Lib/test/test_descr.py

index d096390110282bdc8f488579d803abcc38e68e1a..d75109995e1a466c75d5a8c159118640f8389be6 100644 (file)
@@ -4738,11 +4738,8 @@ class PicklingTests(unittest.TestCase):
                 return (args, kwargs)
         obj = C3()
         for proto in protocols:
-            if proto >= 4:
+            if proto >= 2:
                 self._check_reduce(proto, obj, args, kwargs)
-            elif proto >= 2:
-                with self.assertRaises(ValueError):
-                    obj.__reduce_ex__(proto)
 
         class C4:
             def __getnewargs_ex__(self):
@@ -5061,10 +5058,6 @@ class PicklingTests(unittest.TestCase):
                 kwargs = getattr(cls, 'KWARGS', {})
                 obj = cls(*cls.ARGS, **kwargs)
                 proto = pickle_copier.proto
-                if 2 <= proto < 4 and hasattr(cls, '__getnewargs_ex__'):
-                    with self.assertRaises(ValueError):
-                        pickle_copier.dumps(obj, proto)
-                    continue
                 objcopy = pickle_copier.copy(obj)
                 self._assert_is_copy(obj, objcopy)
                 # For test classes that supports this, make sure we didn't go