Show More
@@ -11,6 +11,7 b' import os' | |||
|
11 | 11 | import sys |
|
12 | 12 | import tempfile |
|
13 | 13 | from datetime import datetime |
|
14 | import sqlite3 | |
|
14 | 15 | |
|
15 | 16 | # third party |
|
16 | 17 | import nose.tools as nt |
@@ -19,10 +20,12 b' import nose.tools as nt' | |||
|
19 | 20 | from traitlets.config.loader import Config |
|
20 | 21 | from IPython.utils.tempdir import TemporaryDirectory |
|
21 | 22 | from IPython.core.history import HistoryManager, extract_hist_ranges |
|
23 | from IPython.testing.decorators import skipif | |
|
22 | 24 | |
|
23 | 25 | def setUp(): |
|
24 | 26 | nt.assert_equal(sys.getdefaultencoding(), "utf-8") |
|
25 | 27 | |
|
28 | @skipif(sqlite3.sqlite_version_info > (3,24,0)) | |
|
26 | 29 | def test_history(): |
|
27 | 30 | ip = get_ipython() |
|
28 | 31 | with TemporaryDirectory() as tmpdir: |
@@ -40,7 +43,7 b' def test_history():' | |||
|
40 | 43 | ip.history_manager.store_output(3) |
|
41 | 44 | |
|
42 | 45 | nt.assert_equal(ip.history_manager.input_hist_raw, [''] + hist) |
|
43 | ||
|
46 | ||
|
44 | 47 | # Detailed tests for _get_range_session |
|
45 | 48 | grs = ip.history_manager._get_range_session |
|
46 | 49 | nt.assert_equal(list(grs(start=2,stop=-1)), list(zip([0], [2], hist[1:-1]))) |
@@ -50,7 +53,7 b' def test_history():' | |||
|
50 | 53 | # Check whether specifying a range beyond the end of the current |
|
51 | 54 | # session results in an error (gh-804) |
|
52 | 55 | ip.magic('%hist 2-500') |
|
53 | ||
|
56 | ||
|
54 | 57 | # Check that we can write non-ascii characters to a file |
|
55 | 58 | ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1")) |
|
56 | 59 | ip.magic("%%hist -pf %s" % os.path.join(tmpdir, "test2")) |
@@ -85,6 +88,7 b' def test_history():' | |||
|
85 | 88 | nt.assert_equal(list(gothist), expected) |
|
86 | 89 | |
|
87 | 90 | # Check get_hist_search |
|
91 | ||
|
88 | 92 | gothist = ip.history_manager.search("*test*") |
|
89 | 93 | nt.assert_equal(list(gothist), [(1,2,hist[1])] ) |
|
90 | 94 |
General Comments 0
You need to be logged in to leave comments.
Login now