mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
[3.13] gh-129870: Skip test_dump_virtual_tables if SQLite lacks FTS4 support (GH-129913) (#129918)
(cherry picked from commit cda83cade0)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
This commit is contained in:
parent
26041daf01
commit
d26c2fe7a2
2 changed files with 10 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
from .util import memory_database
|
||||
from .util import MemoryDatabaseMixin
|
||||
from .util import requires_virtual_table
|
||||
|
||||
|
||||
class DumpTests(MemoryDatabaseMixin, unittest.TestCase):
|
||||
|
|
@ -206,6 +207,7 @@ def dict_factory(cu, row):
|
|||
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 re
|
||||
import sqlite3
|
||||
import test.support
|
||||
import unittest
|
||||
|
||||
|
||||
# Helper for temporary memory databases
|
||||
|
|
@ -75,3 +76,10 @@ def cx(self):
|
|||
@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