diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-10-11 14:52:09 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-10-11 14:52:09 (GMT) |
commit | 20d15b5100bc12b21c561ee1ea70d8436f944d98 (patch) | |
tree | 5ee8502626ed6e22125d0c13a144605974c7f911 /Lib/test/test_descr.py | |
parent | 99deb1989f00a3138117c2cb898123189591a8b0 (diff) | |
download | cpython-20d15b5100bc12b21c561ee1ea70d8436f944d98.zip cpython-20d15b5100bc12b21c561ee1ea70d8436f944d98.tar.gz cpython-20d15b5100bc12b21c561ee1ea70d8436f944d98.tar.bz2 |
Issue #24164: Fixed test_descr: __getnewargs_ex__ now is supported in protocols 2 and 3.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index d096390..d751099 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -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 |