Permalink
Browse files

Add test for writing non-ascii characters to file with %hist.

  • Loading branch information...
takluyver committed Feb 4, 2012
1 parent 54c3e06 commit 5ae50772751967272147f30e9e4f6519ecc2059d
Showing with 9 additions and 0 deletions.
  1. +9 −0 IPython/core/tests/test_history.py
@@ -7,6 +7,7 @@
# stdlib
import os
+import shutil
import sys
import tempfile
import unittest
@@ -51,6 +52,14 @@ def test_history():
# Check whether specifying a range beyond the end of the current
# session results in an error (gh-804)
ip.magic('%hist 2-500')
+
+ # Check that we can write non-ascii characters to a file
+ tmpdir = tempfile.mkdtemp()
+ try:
+ ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1"))
+ ip.magic("%%save %s 1-10" % os.path.join(tmpdir, "test2"))
+ finally:
+ shutil.rmtree(tmpdir)
# New session
ip.history_manager.reset()

0 comments on commit 5ae5077

Please sign in to comment.