From 705688a07c83a308236d025c3af281a95e2d4c16 Mon Sep 17 00:00:00 2001 From: John Haddon Date: Wed, 6 Dec 2023 18:02:34 +0000 Subject: [PATCH] TestCase : Complain about zombie catalogues --- python/GafferTest/TestCase.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/GafferTest/TestCase.py b/python/GafferTest/TestCase.py index fa410204467..d019133f9a7 100644 --- a/python/GafferTest/TestCase.py +++ b/python/GafferTest/TestCase.py @@ -118,6 +118,13 @@ def tearDown( self ) : if message not in self.__messagesToIgnore : self.fail( f"Unexpected message : {message}" ) + import gc + import GafferImage + self.assertEqual( + [ o for o in gc.get_objects() if isinstance( o, GafferImage.Catalogue ) ], + [] + ) + ## Registers a message that will be ignored if it is emitted during the # test run, instead of triggering a failure. def ignoreMessage( self, level, context, message ) :