mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-05-05 16:33:42 +03:00
collect garbage before check memory
This commit is contained in:
parent
6d2be876c8
commit
ae104b0d0e
|
@ -1,5 +1,7 @@
|
||||||
from __future__ import division, print_function
|
from __future__ import division, print_function
|
||||||
|
|
||||||
|
import gc
|
||||||
|
|
||||||
from helper import unittest, PillowTestCase
|
from helper import unittest, PillowTestCase
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
@ -106,6 +108,7 @@ class TestCoreMemory(PillowTestCase):
|
||||||
Image.core.set_block_size(4096)
|
Image.core.set_block_size(4096)
|
||||||
Image.new('RGB', (256, 256))
|
Image.new('RGB', (256, 256))
|
||||||
Image.new('RGB', (256, 256))
|
Image.new('RGB', (256, 256))
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
stats = Image.core.get_stats()
|
stats = Image.core.get_stats()
|
||||||
self.assertGreaterEqual(stats['new_count'], 2)
|
self.assertGreaterEqual(stats['new_count'], 2)
|
||||||
|
@ -120,6 +123,7 @@ class TestCoreMemory(PillowTestCase):
|
||||||
Image.core.set_block_size(4096)
|
Image.core.set_block_size(4096)
|
||||||
Image.new('RGB', (256, 256))
|
Image.new('RGB', (256, 256))
|
||||||
Image.new('RGB', (256, 256))
|
Image.new('RGB', (256, 256))
|
||||||
|
gc.collect()
|
||||||
Image.core.clear_cache()
|
Image.core.clear_cache()
|
||||||
|
|
||||||
stats = Image.core.get_stats()
|
stats = Image.core.get_stats()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user