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

Function eval_formatter_no_slicing_check

IPython/utils/tests/test_text.py:128–138  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

126 nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns)
127
128def 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
140def test_eval_formatter():
141 f = text.EvalFormatter()

Callers 1

test_eval_formatterFunction · 0.85

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected