#NEWLINE# def testPutEnv( self ) : #NEWLINE# #INDENT# 'Put an environment variable and ensure that spawned processes see the change' #NEWLINE# value = 'Value we set' #NEWLINE# os . putenv ( 'NEWVARIABLE' , value ) #NEWLINE# newValue = os . popen ( 'echo $NEWVARIABLE' ) . read ( ) . strip ( ) #NEWLINE# if ( newValue == '$NEWVARIABLE' ) : #NEWLINE# #INDENT# newValue = os . popen ( 'echo %NEWVARIABLE%' ) . read ( ) . strip ( ) #NEWLINE# #UNINDENT# if ( newValue == '%NEWVARIABLE%' ) : #NEWLINE# #INDENT# raise test_support . TestSkipped ( 'Unable to find a subshell to execute echo' ) #NEWLINE# #UNINDENT# assert ( newValue == value ) , ( 'Expected (%s) to equal value we set (%s)' % ( newValue , value ) )