Skip to content

Commit 8505d4b

Browse files
Add some more tests
1 parent 08bdada commit 8505d4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_ctypes/test_pointers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,16 @@ def test_pointer_set_type_twice(self):
287287
self.assertIs(t1._type_, c_int)
288288

289289
def test_pointer_set_wrong_type(self):
290+
class C(c_int):
291+
pass
292+
290293
t1 = POINTER(c_int)
291294
with self.assertRaisesRegex(TypeError, "pointer type already set"):
292295
t1.set_type(c_float)
293296

297+
with self.assertRaisesRegex(TypeError, "cls type already set"):
298+
t1.set_type(C)
299+
294300
def test_pointer_not_ctypes_type(self):
295301
with self.assertRaisesRegex(TypeError, "must have storage info"):
296302
POINTER(int)

0 commit comments

Comments
 (0)