#NEWLINE# def test_parsing( self ) : #NEWLINE# #INDENT# digits = '000000123456789' #NEWLINE# signs = ( '+' , '-' , '' ) #NEWLINE# for i in range ( 1000 ) : #NEWLINE# #INDENT# for j in range ( TEST_SIZE ) : #NEWLINE# #INDENT# s = random . choice ( signs ) #NEWLINE# intpart_len = random . randrange ( 5 ) #NEWLINE# s += '' . join ( ( random . choice ( digits ) for _ in range ( _ ) ) ) #NEWLINE# if random . choice ( [ True , False ] ) : #NEWLINE# #INDENT# s += '.' #NEWLINE# fracpart_len = random . randrange ( 5 ) #NEWLINE# s += '' . join ( ( random . choice ( digits ) for _ in range ( fracpart_len ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fracpart_len = 0 #NEWLINE# #UNINDENT# if random . choice ( [ True , False ] ) : #NEWLINE# #INDENT# s += random . choice ( [ 'e' , 'E' ] ) #NEWLINE# s += random . choice ( signs ) #NEWLINE# exponent_len = random . randrange ( 1 , 4 ) #NEWLINE# s += '' . join ( ( random . choice ( digits ) for _ in range ( exponent_len ) ) ) #NEWLINE# #UNINDENT# if ( intpart_len + fracpart_len ) : #NEWLINE# #INDENT# self . check_strtod ( s ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# float ( s ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert False , 'expected ValueError'