diff --git a/python/GafferTest/TestCase.py b/python/GafferTest/TestCase.py index dbd9f3118a..00ae18614b 100644 --- a/python/GafferTest/TestCase.py +++ b/python/GafferTest/TestCase.py @@ -115,6 +115,9 @@ def tearDown( self ) : IECore.RefCounted.collectGarbage() if self.__temporaryDirectory is not None : + if os.name == "nt" : + subprocess.check_call( [ "icacls", self.temporaryDirectory(), "/grant", "Users:(OI)(CI)(W)" ] ) + for root, dirs, files in os.walk( self.temporaryDirectory() ) : for fileName in [ p for p in files + dirs if not ( pathlib.Path( root ) / p ).is_symlink() ] : ( pathlib.Path( root ) / fileName ).chmod( stat.S_IRWXU ) diff --git a/python/GafferUSDTest/USDLayerWriterTest.py b/python/GafferUSDTest/USDLayerWriterTest.py index 73a81290ff..43eb6913a6 100644 --- a/python/GafferUSDTest/USDLayerWriterTest.py +++ b/python/GafferUSDTest/USDLayerWriterTest.py @@ -265,8 +265,5 @@ def testNoWritePermissions( self ) : with self.assertRaisesRegex( RuntimeError, 'Failed to export layer to "{}"'.format( layerWriter["fileName"].getValue() ) ) : layerWriter["task"].execute() - if os.name == "nt" : - subprocess.check_call( [ "icacls", self.temporaryDirectory(), "/grant", "Users:(OI)(CI)(W)" ] ) - if __name__ == "__main__": unittest.main()