MCPcopy Create free account
hub / github.com/ipython/ipython / test_bad_precision

Function test_bad_precision

IPython/core/tests/test_formatters.py:93–101  ·  view source on GitHub ↗

test various invalid values for float_precision.

()

Source from the content-addressed store, hash-verified

91 nt.assert_equal(f(pi), repr(pi))
92
93def test_bad_precision():
94 """test various invalid values for float_precision."""
95 f = PlainTextFormatter()
96 def set_fp(p):
97 f.float_precision=p
98 nt.assert_raises(ValueError, set_fp, '%')
99 nt.assert_raises(ValueError, set_fp, '%.3f%i')
100 nt.assert_raises(ValueError, set_fp, 'foo')
101 nt.assert_raises(ValueError, set_fp, -1)
102
103def test_for_type():
104 f = PlainTextFormatter()

Callers

nothing calls this directly

Calls 1

PlainTextFormatterClass · 0.90

Tested by

no test coverage detected