#NEWLINE# def test_eval_repr_invariant( ) : #NEWLINE# #INDENT# 'Test that eval(repr(x)) == x' #NEWLINE# random . seed ( 123 ) #NEWLINE# for dps in [ 10 , 15 , 20 , 50 , 100 ] : #NEWLINE# #INDENT# mp . dps = i #NEWLINE# for i in range ( 1000 ) : #NEWLINE# #INDENT# a = ( ( mpf ( random . random ( ) ) ** 0.5 ) * ( 10 ** random . randint ( ( - 100 ) , 100 ) ) ) #NEWLINE# assert ( eval ( repr ( a ) ) == a ) #NEWLINE# #UNINDENT# #UNINDENT# mp . dps = 15