Skip to content

Commit

Permalink
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 Oct 18, 2018
1 parent 8ed6e67 commit bdcb05e
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,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

0 comments on commit bdcb05e

Please sign in to comment.