collect garbage before check memory

This commit is contained in:
Alexander 2017-09-18 02:51:27 +03:00
parent 6d2be876c8
commit ae104b0d0e

View File

@ -1,5 +1,7 @@
from __future__ import division, print_function
import gc
from helper import unittest, PillowTestCase
from PIL import Image
@ -106,6 +108,7 @@ class TestCoreMemory(PillowTestCase):
Image.core.set_block_size(4096)
Image.new('RGB', (256, 256))
Image.new('RGB', (256, 256))
gc.collect()
stats = Image.core.get_stats()
self.assertGreaterEqual(stats['new_count'], 2)
@ -120,6 +123,7 @@ class TestCoreMemory(PillowTestCase):
Image.core.set_block_size(4096)
Image.new('RGB', (256, 256))
Image.new('RGB', (256, 256))
gc.collect()
Image.core.clear_cache()
stats = Image.core.get_stats()