Show More
@@ -76,13 +76,15 b' def eval_formatter_slicing_check(f):' | |||
|
76 | 76 | |
|
77 | 77 | nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns) |
|
78 | 78 | |
|
79 | ||
|
80 | 79 | def eval_formatter_no_slicing_check(f): |
|
81 | 80 | ns = dict(n=12, pi=math.pi, stuff='hello there', os=os) |
|
82 | 81 | |
|
83 | 82 | s = f.format('{n:x} {pi**2:+f}', **ns) |
|
84 | 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 | 88 | nt.assert_raises(SyntaxError, f.format, "{a[:]}") |
|
87 | 89 | |
|
88 | 90 | def test_eval_formatter(): |
General Comments 0
You need to be logged in to leave comments.
Login now