Commit 7cc3bf1e authored by Nicolas Wavrant's avatar Nicolas Wavrant

wip fixup

parent ec1a7f1e
...@@ -3165,25 +3165,38 @@ class TestZodbDocumentComponentReload(TestZodbDocumentComponent): ...@@ -3165,25 +3165,38 @@ class TestZodbDocumentComponentReload(TestZodbDocumentComponent):
def testAsComposedDocumentDoesntLeakTypes(self): def testAsComposedDocumentDoesntLeakTypes(self):
from pympler import muppy from pympler import muppy
import gc
import types import types
movement = self.portal.newContent(portal_type='Movement')
movement.asComposedDocument()
gc.collect()
all_object_list = muppy.get_objects() all_object_list = muppy.get_objects()
class_object_list = muppy.filter(all_object_list, Type=types.ClassType) class_object_list = muppy.filter(all_object_list, Type=types.ClassType)
type_object_list = muppy.filter(all_object_list, Type=types.TypeType) type_object_list = muppy.filter(all_object_list, Type=types.TypeType)
self.assertEqual(
sorted(class_object_list),
sorted(class_object_list),
)
self.assertEqual(
sorted(type_object_list),
sorted(type_object_list),
)
movement = self.portal.newContent(portal_type='Movement')
for _ in range(10): for _ in range(10):
movement.asComposedDocument() movement.asComposedDocument()
self.tic() self.tic()
gc.collect()
all_object_list = muppy.get_objects() all_object_list = muppy.get_objects()
self.assertEqual( self.assertEqual(
class_object_list, class_object_list,
muppy.filter(all_object_list, Type=types.ClassType), muppy.filter(all_object_list, Type=types.ClassType),
) )
self.assertEqual( self.assertEqual(
type_object_list, sorted(type_object_list),
muppy.filter(all_object_list, Type=types.TypeType) sorted(muppy.filter(all_object_list, Type=types.TypeType))
) )
def _setBusinessProcessComponentTextContent(self, value): def _setBusinessProcessComponentTextContent(self, value):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment