Skip to content

Commit faabc3d

Browse files
Added memory test on the python side
1 parent 34c0753 commit faabc3d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • rust/arrow-pyarrow-integration-testing/tests

rust/arrow-pyarrow-integration-testing/tests/test_sql.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ def test_primitive_rust(self):
4040
"""
4141
Rust -> Python -> Rust
4242
"""
43+
old_allocated = pyarrow.total_allocated_bytes()
44+
4345
def double(array):
4446
array = array.to_pylist()
4547
return pyarrow.array([x * 2 if x is not None else None for x in array])
46-
48+
4749
is_correct = arrow_pyarrow_integration_testing.double_py(double)
4850
self.assertTrue(is_correct)
51+
# No leak of C++ memory
52+
self.assertEqual(old_allocated, pyarrow.total_allocated_bytes())
4953

5054
def test_string_python(self):
5155
"""

0 commit comments

Comments
 (0)