##// END OF EJS Templates
Add test for writing non-ascii characters to file with %hist.
Thomas Kluyver -
Show More
@@ -7,6 +7,7 b''
7
7
8 # stdlib
8 # stdlib
9 import os
9 import os
10 import shutil
10 import sys
11 import sys
11 import tempfile
12 import tempfile
12 import unittest
13 import unittest
@@ -51,6 +52,14 b' def test_history():'
51 # Check whether specifying a range beyond the end of the current
52 # Check whether specifying a range beyond the end of the current
52 # session results in an error (gh-804)
53 # session results in an error (gh-804)
53 ip.magic('%hist 2-500')
54 ip.magic('%hist 2-500')
55
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)
54
63
55 # New session
64 # New session
56 ip.history_manager.reset()
65 ip.history_manager.reset()
General Comments 0
You need to be logged in to leave comments. Login now