Import pysqlite3 if available, closes #360

This commit is contained in:
Simon Willison 2018-08-15 17:51:46 -07:00
commit da41daa168
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
8 changed files with 18 additions and 10 deletions

View file

@ -7,7 +7,6 @@ import json
import os
import pytest
from sanic.request import Request
import sqlite3
import tempfile
from unittest.mock import patch
@ -228,7 +227,7 @@ def test_detect_fts():
CREATE VIRTUAL TABLE "Street_Tree_List_fts" USING FTS4 ("qAddress", "qCaretaker", "qSpecies", content="Street_Tree_List");
CREATE VIRTUAL TABLE r USING rtree(a, b, c);
'''
conn = sqlite3.connect(':memory:')
conn = utils.sqlite3.connect(':memory:')
conn.executescript(sql)
assert None is utils.detect_fts(conn, 'Dumb_Table')
assert None is utils.detect_fts(conn, 'Test_View')