From faabc3dc67acf4e958de3235bc25608fa66ead59 Mon Sep 17 00:00:00 2001 From: "Jorge C. Leitao" Date: Tue, 1 Dec 2020 18:43:33 +0100 Subject: [PATCH] Added memory test on the python side --- rust/arrow-pyarrow-integration-testing/tests/test_sql.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rust/arrow-pyarrow-integration-testing/tests/test_sql.py b/rust/arrow-pyarrow-integration-testing/tests/test_sql.py index d566d1cf20d9e..bd332fa865f45 100644 --- a/rust/arrow-pyarrow-integration-testing/tests/test_sql.py +++ b/rust/arrow-pyarrow-integration-testing/tests/test_sql.py @@ -40,12 +40,16 @@ def test_primitive_rust(self): """ Rust -> Python -> Rust """ + old_allocated = pyarrow.total_allocated_bytes() + def double(array): array = array.to_pylist() return pyarrow.array([x * 2 if x is not None else None for x in array]) - + is_correct = arrow_pyarrow_integration_testing.double_py(double) self.assertTrue(is_correct) + # No leak of C++ memory + self.assertEqual(old_allocated, pyarrow.total_allocated_bytes()) def test_string_python(self): """