File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,21 +111,17 @@ def test_ctypes_array_class_assignment_incompatible(self):
111111 with self .assertRaises (TypeError ):
112112 x .__class__ = B
113113
114- def test_ctypes_array_class_assignment_abstract_target (self ):
115- class AbstractArray (Array ):
116- pass
114+ def test_ctypes_array_class_assignment_incompatible_target (self ):
117115 A = c_int * 3
116+ class OtherArray (Array ):
117+ _type_ = c_int
118+ _length_ = 4 # incompatible length
119+
118120 a = A ()
119121
120122 with self .assertRaises (TypeError ):
121- a .__class__ = AbstractArray
123+ a .__class__ = OtherArray
122124
123- def test_ctypes_array_class_assignment_non_array_instance (self ):
124- p = POINTER (c_int )()
125- A = c_int * 3
126-
127- with self .assertRaises (TypeError ):
128- p .__class__ = A
129125
130126 def test_ctypes_array_class_assignment_zero_length (self ):
131127 A = c_long * 0
You can’t perform that action at this time.
0 commit comments