From 5ae50772751967272147f30e9e4f6519ecc2059d 2012-02-04 23:13:46 From: Thomas Kluyver Date: 2012-02-04 23:13:46 Subject: [PATCH] Add test for writing non-ascii characters to file with %hist. --- diff --git a/IPython/core/tests/test_history.py b/IPython/core/tests/test_history.py index 5b485cf..99f3a83 100644 --- a/IPython/core/tests/test_history.py +++ b/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()