From dbe0304bb3145e1aaf6a51383821648b772c8002 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sat, 25 Jan 2025 14:12:31 +0000 Subject: [PATCH] Tests for destructors of the PyCapsules --- Tests/test_arrow.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Tests/test_arrow.py b/Tests/test_arrow.py index 68a4f96f0..f1ab5ab6d 100644 --- a/Tests/test_arrow.py +++ b/Tests/test_arrow.py @@ -105,3 +105,17 @@ def test_lifetime2(): img2 = img.copy() px = img2.load() assert isinstance(px[0, 0], int) + + +def test_release_schema(): + # these should not error out, valgrind should be clean + img = hopper('L') + schema = img.__arrow_c_schema__() + del(schema) + +def test_release_array(): + # these should not error out, valgrind should be clean + img = hopper('L') + array, schema = img.__arrow_c_array__() + del(array) + del(schema)