mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
gh-129870: Skip test_dump_virtual_tables if SQLite lacks FTS4 support (#129913)
This commit is contained in:
parent
91d9544112
commit
cda83cade0
2 changed files with 10 additions and 0 deletions
|
@ -4,6 +4,7 @@ import unittest
|
|||
|
||||
from .util import memory_database
|
||||
from .util import MemoryDatabaseMixin
|
||||
from .util import requires_virtual_table
|
||||
|
||||
|
||||
class DumpTests(MemoryDatabaseMixin, unittest.TestCase):
|
||||
|
@ -206,6 +207,7 @@ class DumpTests(MemoryDatabaseMixin, unittest.TestCase):
|
|||
self.assertEqual(expected, actual)
|
||||
self.assertEqual(self.cx.row_factory, dict_factory)
|
||||
|
||||
@requires_virtual_table("fts4")
|
||||
def test_dump_virtual_tables(self):
|
||||
# gh-64662
|
||||
expected = [
|
||||
|
|
|
@ -4,6 +4,7 @@ import io
|
|||
import re
|
||||
import sqlite3
|
||||
import test.support
|
||||
import unittest
|
||||
|
||||
|
||||
# Helper for temporary memory databases
|
||||
|
@ -79,3 +80,10 @@ class MemoryDatabaseMixin:
|
|||
@property
|
||||
def cu(self):
|
||||
return self.cur
|
||||
|
||||
|
||||
def requires_virtual_table(module):
|
||||
with memory_database() as cx:
|
||||
supported = (module,) in list(cx.execute("PRAGMA module_list"))
|
||||
reason = f"Requires {module!r} virtual table support"
|
||||
return unittest.skipUnless(supported, reason)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue