#NEWLINE# def test_iter_file( self ) : #NEWLINE# #INDENT# f = open ( TESTFN , 'w' ) #NEWLINE# try : #NEWLINE# #INDENT# for i in range ( 5 ) : #NEWLINE# #INDENT# f . write ( ( '%d\n' % i ) ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( ) #NEWLINE# #UNINDENT# f = open ( TESTFN , 'r' ) #NEWLINE# try : #NEWLINE# #INDENT# self . check_for_loop ( self , [ '0\n' , '1\n' , '2\n' , '3\n' , '4\n' ] , pickle = False ) #NEWLINE# self . check_for_loop ( f , [ ] , pickle = False ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# f . close ( ) #NEWLINE# try : #NEWLINE# #INDENT# unlink ( TESTFN ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# pass