Show More
@@ -75,7 +75,6 b' def eval_formatter_slicing_check(f):' | |||
|
75 | 75 | nt.assert_equals(s, ns['stuff'][::2]) |
|
76 | 76 | |
|
77 | 77 | nt.assert_raises(SyntaxError, f.format, "{n:x}", **ns) |
|
78 | ||
|
79 | 78 | |
|
80 | 79 | def eval_formatter_no_slicing_check(f): |
|
81 | 80 | ns = dict(n=12, pi=math.pi, stuff='hello there', os=os) |
@@ -83,6 +82,9 b' def eval_formatter_no_slicing_check(f):' | |||
|
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