Skip to content

Commit

Permalink
Add test for writing non-ascii characters to file with %hist.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Feb 4, 2012
1 parent 54c3e06 commit 5ae5077
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions IPython/core/tests/test_history.py
Expand Up @@ -7,6 +7,7 @@

# stdlib
import os
import shutil
import sys
import tempfile
import unittest
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5ae5077

Please sign in to comment.