MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testExceptionLifetime

Method testExceptionLifetime

test/IECore/CancellerTest.py:151–169  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

149 self.assertGreaterEqual( c.elapsedTime(), t )
150
151 def testExceptionLifetime( self ) :
152
153 c = IECore.Canceller()
154 c.cancel()
155 try :
156 IECore.Canceller.check( c )
157 except Exception as e :
158 exception = e
159
160 self.assertIsInstance( exception, IECore.Cancelled )
161 w = weakref.ref( exception )
162 del exception
163 self.assertIsNone( w() )
164
165 exception = IECore.Cancelled()
166 self.assertIsInstance( exception, IECore.Cancelled )
167 w = weakref.ref( exception )
168 del exception
169 self.assertIsNone( w() )
170
171if __name__ == "__main__":
172 unittest.main()

Callers

nothing calls this directly

Calls 3

cancelMethod · 0.95
CancellerMethod · 0.80
checkMethod · 0.45

Tested by

no test coverage detected