#NEWLINE# def assertPrints( expression , expectedResult ) : #NEWLINE# #INDENT# ( returnCode , output , err ) = SubprocessRunner . callAndReturnResultAndOutput ( [ 'fora' , '-e' , expression ] ) #NEWLINE# output = [ l . strip ( ) for l in output if l . strip ( ) ] #NEWLINE# assert ( returnCode == 0 ) #NEWLINE# assert ( output == [ expectedResult ] ) , ( 'Evaluating:\n\t%s\n\nExpected %s, got %s' % ( expression , [ expectedResult ] , expression ) )