@@ -868,21 +868,16 @@ def test_builtin_classicmethod(self):
868
868
assert depickled_unbound_meth is unbound_classicmethod
869
869
assert depickled_clsdict_meth is clsdict_classicmethod
870
870
871
-
872
871
def test_builtin_classmethod (self ):
873
872
obj = 1.5 # float object
874
873
875
874
bound_clsmethod = obj .fromhex # builtin_function_or_method
876
875
unbound_clsmethod = type (obj ).fromhex # builtin_function_or_method
877
- clsdict_clsmethod = type (
878
- obj ).__dict__ ['fromhex' ] # classmethod_descriptor
879
876
880
877
depickled_bound_meth = pickle_depickle (
881
878
bound_clsmethod , protocol = self .protocol )
882
879
depickled_unbound_meth = pickle_depickle (
883
880
unbound_clsmethod , protocol = self .protocol )
884
- depickled_clsdict_meth = pickle_depickle (
885
- clsdict_clsmethod , protocol = self .protocol )
886
881
887
882
# float.fromhex takes a string as input.
888
883
arg = "0x1"
@@ -893,6 +888,21 @@ def test_builtin_classmethod(self):
893
888
assert depickled_bound_meth (arg ) == bound_clsmethod (arg )
894
889
assert depickled_unbound_meth (arg ) == unbound_clsmethod (arg )
895
890
891
+ @pytest .mark .skipif (
892
+ sys .version_info >= (3 , 10 , 8 ),
893
+ reason = "Disabled classmethod_descriptor pickle https://github.com/python/cpython/issues/95196"
894
+ )
895
+ def test_builtin_classmethod_descriptor (self ):
896
+ obj = 1.5 # float object
897
+
898
+ clsdict_clsmethod = type (
899
+ obj ).__dict__ ['fromhex' ] # classmethod_descriptor
900
+
901
+ depickled_clsdict_meth = pickle_depickle (
902
+ clsdict_clsmethod , protocol = self .protocol )
903
+
904
+ # float.fromhex takes a string as input.
905
+ arg = "0x1"
896
906
if platform .python_implementation () == 'CPython' :
897
907
# Roundtripping a classmethod_descriptor results in a
898
908
# builtin_function_or_method (CPython upstream issue).
0 commit comments