##// END OF EJS Templates
Fix tests in IPython.core
Thomas Kluyver -
Show More
@@ -24,7 +24,7 b' def exception_colors():'
24 >>> ec = exception_colors()
24 >>> ec = exception_colors()
25 >>> ec.active_scheme_name
25 >>> ec.active_scheme_name
26 ''
26 ''
27 >>> print ec.active_colors
27 >>> print(ec.active_colors)
28 None
28 None
29
29
30 Now we activate a color scheme:
30 Now we activate a color scheme:
@@ -43,9 +43,9 b' def test_history():'
43
43
44 # Detailed tests for _get_range_session
44 # Detailed tests for _get_range_session
45 grs = ip.history_manager._get_range_session
45 grs = ip.history_manager._get_range_session
46 nt.assert_equal(list(grs(start=2,stop=-1)), zip([0], [2], hist[1:-1]))
46 nt.assert_equal(list(grs(start=2,stop=-1)), list(zip([0], [2], hist[1:-1])))
47 nt.assert_equal(list(grs(start=-2)), zip([0,0], [2,3], hist[-2:]))
47 nt.assert_equal(list(grs(start=-2)), list(zip([0,0], [2,3], hist[-2:])))
48 nt.assert_equal(list(grs(output=True)), zip([0,0,0], [1,2,3], zip(hist, [None,None,'spam'])))
48 nt.assert_equal(list(grs(output=True)), list(zip([0,0,0], [1,2,3], zip(hist, [None,None,'spam']))))
49
49
50 # Check whether specifying a range beyond the end of the current
50 # Check whether specifying a range beyond the end of the current
51 # session results in an error (gh-804)
51 # session results in an error (gh-804)
@@ -66,10 +66,10 b' def test_history():'
66 for i, cmd in enumerate(newcmds, start=1):
66 for i, cmd in enumerate(newcmds, start=1):
67 ip.history_manager.store_inputs(i, cmd)
67 ip.history_manager.store_inputs(i, cmd)
68 gothist = ip.history_manager.get_range(start=1, stop=4)
68 gothist = ip.history_manager.get_range(start=1, stop=4)
69 nt.assert_equal(list(gothist), zip([0,0,0],[1,2,3], newcmds))
69 nt.assert_equal(list(gothist), list(zip([0,0,0],[1,2,3], newcmds)))
70 # Previous session:
70 # Previous session:
71 gothist = ip.history_manager.get_range(-1, 1, 4)
71 gothist = ip.history_manager.get_range(-1, 1, 4)
72 nt.assert_equal(list(gothist), zip([1,1,1],[1,2,3], hist))
72 nt.assert_equal(list(gothist), list(zip([1,1,1],[1,2,3], hist)))
73
73
74 newhist = [(2, i, c) for (i, c) in enumerate(newcmds, 1)]
74 newhist = [(2, i, c) for (i, c) in enumerate(newcmds, 1)]
75
75
General Comments 0
You need to be logged in to leave comments. Login now