def test_bad_precision():
 f = PlainTextFormatter()
 def set_fp(p):
  f.float_precision = p
 nt.assert_raises(ValueError, set_fp, '%')
 nt.assert_raises(ValueError, set_fp, '%.3f%i')
 nt.assert_raises(ValueError, set_fp, 'foo')
 nt.assert_raises(ValueError, set_fp, (-1))

def test_bad_precision ( ) : f = PlainTextFormatter ( ) def set_fp ( p ) : f . float_precision = p nt . assert_raises ( ValueError , set_fp , '%' ) nt . assert_raises ( ValueError , set_fp , '%.3f%i' ) nt . assert_raises ( ValueError , set_fp , 'foo' ) nt . assert_raises ( ValueError , set_fp , ( - 1 ) )
test various invalid values for float_precision .