##// END OF EJS Templates
Sort out the different implementations of EvalFormatter, so we usually use the simple one.
Thomas Kluyver -
Show More
@@ -76,13 +76,15 b' def eval_formatter_slicing_check(f):'
76
76
77 nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns)
77 nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns)
78
78
79
80 def eval_formatter_no_slicing_check(f):
79 def eval_formatter_no_slicing_check(f):
81 ns = dict(n=12, pi=math.pi, stuff='hello there', os=os)
80 ns = dict(n=12, pi=math.pi, stuff='hello there', os=os)
82
81
83 s = f.format('{n:x} {pi**2:+f}', **ns)
82 s = f.format('{n:x} {pi**2:+f}', **ns)
84 nt.assert_equals(s, "c +9.869604")
83 nt.assert_equals(s, "c +9.869604")
85
84
85 s = f.format('{stuff[slice(1,4)]}', **ns)
86 nt.assert_equals(s, 'ell')
87
86 nt.assert_raises(SyntaxError, f.format, "{a[:]}")
88 nt.assert_raises(SyntaxError, f.format, "{a[:]}")
87
89
88 def test_eval_formatter():
90 def test_eval_formatter():
General Comments 0
You need to be logged in to leave comments. Login now