#NEWLINE# def test_iter_function_stop( self ) : #NEWLINE# #INDENT# def spam( state = [ 0 ] ) : #NEWLINE# #INDENT# i = state [ 0 ] #NEWLINE# if ( i == 10 ) : #NEWLINE# #INDENT# raise StopIteration #NEWLINE# #UNINDENT# state [ 0 ] = ( i + 1 ) #NEWLINE# return i #NEWLINE# #UNINDENT# self . check_iterator ( iter ( self , 20 ) , list ( range ( 10 ) ) , pickle = False )