Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added skipif for sqlite3 version > 3.24.0 in tests history #11401

Merged
merged 1 commit into from Oct 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions IPython/core/tests/test_history.py
Expand Up @@ -11,6 +11,7 @@
import sys
import tempfile
from datetime import datetime
import sqlite3

# third party
import nose.tools as nt
Expand All @@ -19,10 +20,12 @@
from traitlets.config.loader import Config
from IPython.utils.tempdir import TemporaryDirectory
from IPython.core.history import HistoryManager, extract_hist_ranges
from IPython.testing.decorators import skipif

def setUp():
nt.assert_equal(sys.getdefaultencoding(), "utf-8")

@skipif(sqlite3.sqlite_version_info > (3,24,0))
def test_history():
ip = get_ipython()
with TemporaryDirectory() as tmpdir:
Expand All @@ -40,7 +43,7 @@ def test_history():
ip.history_manager.store_output(3)

nt.assert_equal(ip.history_manager.input_hist_raw, [''] + hist)

# Detailed tests for _get_range_session
grs = ip.history_manager._get_range_session
nt.assert_equal(list(grs(start=2,stop=-1)), list(zip([0], [2], hist[1:-1])))
Expand All @@ -50,7 +53,7 @@ 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
ip.magic("%%hist -f %s" % os.path.join(tmpdir, "test1"))
ip.magic("%%hist -pf %s" % os.path.join(tmpdir, "test2"))
Expand Down Expand Up @@ -85,6 +88,7 @@ def test_history():
nt.assert_equal(list(gothist), expected)

# Check get_hist_search

gothist = ip.history_manager.search("*test*")
nt.assert_equal(list(gothist), [(1,2,hist[1])] )

Expand Down