(f)
| 126 | nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns) |
| 127 | |
| 128 | def eval_formatter_no_slicing_check(f): |
| 129 | ns = dict(n=12, pi=math.pi, stuff='hello there', os=os) |
| 130 | |
| 131 | s = f.format('{n:x} {pi**2:+f}', **ns) |
| 132 | nt.assert_equal(s, "c +9.869604") |
| 133 | |
| 134 | s = f.format('{stuff[slice(1,4)]}', **ns) |
| 135 | nt.assert_equal(s, 'ell') |
| 136 | |
| 137 | s = f.format("{a[:]}", a=[1, 2]) |
| 138 | nt.assert_equal(s, "[1, 2]") |
| 139 | |
| 140 | def test_eval_formatter(): |
| 141 | f = text.EvalFormatter() |
no test coverage detected