##// END OF EJS Templates
Fix tests for saving non-ascii history.
Thomas Kluyver -
Show More
@@ -32,7 +32,7 b' def test_history():'
32 32 hist_file = os.path.join(tmpdir, 'history.sqlite')
33 33 try:
34 34 ip.history_manager = HistoryManager(shell=ip, hist_file=hist_file)
35 hist = ['a=1', 'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"]
35 hist = [u'a=1', u'def f():\n test = 1\n return test', u"b='€Æ¾÷ß'"]
36 36 for i, h in enumerate(hist, start=1):
37 37 ip.history_manager.store_inputs(i, h)
38 38
@@ -54,12 +54,10 b' def test_history():'
54 54 ip.magic('%hist 2-500')
55 55
56 56 # Check that we can write non-ascii characters to a file
57 tmpdir = tempfile.mkdtemp()
58 try:
59 ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1"))
60 ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test2"))
61 finally:
62 shutil.rmtree(tmpdir)
57 ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1"))
58 ip.magic("%%hist -pf %s" % os.path.join(tmpdir, "test2"))
59 ip.magic("%%hist -nf %s" % os.path.join(tmpdir, "test3"))
60 ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test4"))
63 61
64 62 # New session
65 63 ip.history_manager.reset()
General Comments 0
You need to be logged in to leave comments. Login now