##// END OF EJS Templates
Fix EvalFormatter test for Python 3.4...
Thomas Kluyver -
Show More
@@ -16,6 +16,7 b' from __future__ import print_function'
16 import os
16 import os
17 import math
17 import math
18 import random
18 import random
19 import sys
19
20
20 import nose.tools as nt
21 import nose.tools as nt
21
22
@@ -108,6 +109,11 b' def eval_formatter_no_slicing_check(f):'
108 s = f.format('{stuff[slice(1,4)]}', **ns)
109 s = f.format('{stuff[slice(1,4)]}', **ns)
109 nt.assert_equal(s, 'ell')
110 nt.assert_equal(s, 'ell')
110
111
112 if sys.version_info >= (3, 4):
113 # String formatting has changed in Python 3.4, so this now works.
114 s = f.format("{a[:]}", a=[1, 2])
115 nt.assert_equal(s, "[1, 2]")
116 else:
111 nt.assert_raises(SyntaxError, f.format, "{a[:]}")
117 nt.assert_raises(SyntaxError, f.format, "{a[:]}")
112
118
113 def test_eval_formatter():
119 def test_eval_formatter():
General Comments 0
You need to be logged in to leave comments. Login now