From 2c0348256935aa8aad46bd46dceca3cc93f5a388 Mon Sep 17 00:00:00 2001 From: Eugene Kliuchnikov Date: Fri, 23 Mar 2018 02:09:00 +0600 Subject: Fix "memory leak" in python tests (#652) OOMs on RPi (1GB) --- python/tests/compressor_test.py | 3 +++ python/tests/decompressor_test.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/python/tests/compressor_test.py b/python/tests/compressor_test.py index 22e3bc5..2d47919 100644 --- a/python/tests/compressor_test.py +++ b/python/tests/compressor_test.py @@ -17,6 +17,9 @@ class _TestCompressor(object): CHUNK_SIZE = 2048 + def tearDown(self): + self.compressor = None + def _check_decompression(self, test_data): # Write decompression to temp file and verify it matches the original. temp_uncompressed = _test_utils.get_temp_uncompressed_name(test_data) diff --git a/python/tests/decompressor_test.py b/python/tests/decompressor_test.py index afa127f..99667bc 100644 --- a/python/tests/decompressor_test.py +++ b/python/tests/decompressor_test.py @@ -21,6 +21,9 @@ class TestDecompressor(_test_utils.TestCase): def setUp(self): self.decompressor = brotli.Decompressor() + def tearDown(self): + self.decompressor = None + def _check_decompression(self, test_data): # Verify decompression matches the original. temp_uncompressed = _test_utils.get_temp_uncompressed_name(test_data) -- cgit v1.1