Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fixing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Sep 6, 2021
1 parent e3f3155 commit 4315a94
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 16 deletions.
6 changes: 0 additions & 6 deletions arrow-pyarrow-integration-testing/src/lib.rs
Expand Up @@ -152,14 +152,8 @@ fn round_trip_field(array: PyObject, py: Python) -> PyResult<PyObject> {
to_py_field(&field, py)
}

#[pyfunction]
fn total_allocated_bytes() -> PyResult<isize> {
Ok(arrow2::total_allocated_bytes())
}

#[pymodule]
fn arrow_pyarrow_integration_testing(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_function(wrap_pyfunction!(total_allocated_bytes, m)?)?;
m.add_function(wrap_pyfunction!(round_trip_array, m)?)?;
m.add_function(wrap_pyfunction!(round_trip_field, m)?)?;
Ok(())
Expand Down
9 changes: 0 additions & 9 deletions arrow-pyarrow-integration-testing/tests/test_sql.py
Expand Up @@ -33,18 +33,9 @@ def __reduce__(self):

class TestCase(unittest.TestCase):
def setUp(self):
self.old_allocated_rust = (
arrow_pyarrow_integration_testing.total_allocated_bytes()
)
self.old_allocated_cpp = pyarrow.total_allocated_bytes()

def tearDown(self):
# No leak of Rust
self.assertEqual(
self.old_allocated_rust,
arrow_pyarrow_integration_testing.total_allocated_bytes(),
)

# No leak of C++ memory
self.assertEqual(self.old_allocated_cpp, pyarrow.total_allocated_bytes())

Expand Down
2 changes: 1 addition & 1 deletion src/buffer/mutable.rs
Expand Up @@ -233,7 +233,7 @@ impl<T: NativeType> MutableBuffer<T> {
/// buffer.push(2);
///
/// buffer.shrink_to_fit();
/// assert!(buffer.capacity() == 8);
/// assert!(buffer.capacity() == 2);
/// ```
pub fn shrink_to_fit(&mut self) {
self.data.shrink_to_fit();
Expand Down

0 comments on commit 4315a94

Please sign in to comment.