""" Tests for the garbage collection of objects in tvtk package.
"""
# Authors: Deepak Surti, Ioannis Tziakos
# Copyright (c) 2015, Enthought, Inc.
# License: BSD Style.

import unittest
from traits.etsconfig.api import ETSConfig

from tvtk.pyface.scene import Scene
from tvtk.pyface.scene_model import SceneModel
from tvtk.tests.common import TestGarbageCollection

class TestTVTKGarbageCollection(TestGarbageCollection):
    """ See: tvtk.tests.common.TestGarbageCollection
    """
    
    @unittest.skipIf(
        ETSConfig.toolkit=='wx', 'Test segfaults using WX (issue #216)')
    def test_scene(self):
        """ Tests if Scene can be garbage collected."""
        def obj_fn():
            return Scene()

        def close_fn(o):
            o.closed = True

        self.check_object_garbage_collected(obj_fn, close_fn)
    
    def test_scene_model(self):
        """ Tests if SceneModel can be garbage collected."""
        def create_fn():
            return SceneModel()

        def close_fn(obj):
            obj.closed = True

        self.check_object_garbage_collected(create_fn, close_fn)

@@ -224,16 +224,61 @@
 Config%0A%0A
+from tvtk.pyface.tvtk_scene import TVTKScene%0A
 from tvt
@@ -301,24 +301,24 @@
 mport Scene%0A
-
 from tvtk.py
@@ -518,24 +518,292 @@
 ion%0A    %22%22%22%0A
+    def test_tvtk_scene(self):%0A        %22%22%22 Tests if TVTK scene can be garbage collected.%22%22%22%0A        def create_fn():%0A            return TVTKScene()%0A%0A        def close_fn(o):%0A            o.closed = True%0A%0A        self.check_object_garbage_collected(create_fn, close_fn)%0A
     %0A    @un
@@ -984,19 +984,22 @@
     def 
-obj
+create
 _fn():%0A 
@@ -1123,19 +1123,22 @@
 llected(
-obj
+create
 _fn, clo

Test TVTKScene garbage collection and renaming