Skip to content

Commit

Permalink
Backport PR ipython#11401: Added skipif for sqlite3 version > 3.24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianaMarques authored and Carreau committed Nov 3, 2018
1 parent c4487d1 commit 073beab
Showing 1 changed file with 6 additions and 2 deletions.
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,11 +20,13 @@
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
from IPython.utils import py3compat

def setUp():
nt.assert_equal(sys.getdefaultencoding(), "utf-8" if py3compat.PY3 else "ascii")

@skipif(sqlite3.sqlite_version_info > (3,24,0))
def test_history():
ip = get_ipython()
with TemporaryDirectory() as tmpdir:
Expand All @@ -41,7 +44,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 @@ -51,7 +54,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 @@ -86,6 +89,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

0 comments on commit 073beab

Please sign in to comment.