Skip to content

Commit

Permalink
IECoreRenderManTest.RendererTest : testOutput fix
Browse files Browse the repository at this point in the history
On Windows, we need to close the image before attempting to delete the
temporary files in `tearDown()` so the OS will let them be deleted.
  • Loading branch information
ericmehl committed Feb 24, 2025
1 parent 61a02d2 commit 62b96c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/IECoreRenderManTest/RendererTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ def testOutput( self ) :
del r

self.assertTrue( ( self.temporaryDirectory() / "rgb.exr" ).is_file() )
imageSpec = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgb.exr" ) ).spec()
imageFile = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgb.exr" ) )
imageSpec = imageFile.spec()
imageFile.close()
self.assertEqual( imageSpec.nchannels, 3 )
self.assertEqual( imageSpec.channelnames, ( "R", "G", "B" ) )

self.assertTrue( ( self.temporaryDirectory() / "rgba.exr" ).is_file() )
imageSpec = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgba.exr" ) ).spec()
imageFile = OpenImageIO.ImageInput.open( str( self.temporaryDirectory() / "rgba.exr" ) )
imageSpec = imageFile.spec()
imageFile.close()
self.assertEqual( imageSpec.nchannels, 4 )
self.assertEqual( imageSpec.channelnames, ( "R", "G", "B", "A" ) )

Expand Down

0 comments on commit 62b96c1

Please sign in to comment.