##// END OF EJS Templates
Fix for loading history with unicode characters. Not sure if this is the best way to do it - sys.stdin.encoding is None in the test suite.
Thomas Kluyver -
Show More
@@ -25,8 +25,8 b' class HistoryTest(unittest.TestCase):'
25 with TemporaryDirectory() as tmpdir:
25 with TemporaryDirectory() as tmpdir:
26 histfile = os.path.realpath(os.path.join(tmpdir, 'history.json'))
26 histfile = os.path.realpath(os.path.join(tmpdir, 'history.json'))
27 # Ensure that we restore the history management that we mess with in
27 # Ensure that we restore the history management that we mess with in
28 # this test doesn't affect the IPython instance used by the test suite
28 # this test doesn't affect the IPython instance used by the test
29 # beyond this test.
29 # suite beyond this test.
30 hist_manager_ori = ip.history_manager
30 hist_manager_ori = ip.history_manager
31 try:
31 try:
32 ip.history_manager = HistoryManager(ip)
32 ip.history_manager = HistoryManager(ip)
@@ -40,9 +40,9 b' class HistoryTest(unittest.TestCase):'
40 ip.save_history()
40 ip.save_history()
41 ip.history_manager.input_hist_raw[:] = []
41 ip.history_manager.input_hist_raw[:] = []
42 ip.reload_history()
42 ip.reload_history()
43 self.assert_equal(len(ip.history_manager.input_hist_raw), len(hist))
43 self.assertEqual(len(ip.history_manager.input_hist_raw), len(hist))
44 for i,h in enumerate(hist):
44 for i,h in enumerate(hist):
45 nt.assert_equal(hist[i], ip.history_manager.input_hist_raw[i])
45 self.assertEqual(hist[i], ip.history_manager.input_hist_raw[i])
46 finally:
46 finally:
47 # Restore history manager
47 # Restore history manager
48 ip.history_manager = hist_manager_ori
48 ip.history_manager = hist_manager_ori
General Comments 0
You need to be logged in to leave comments. Login now