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