Skip to content

[3.13] gh-129870: Skip test_dump_virtual_tables if SQLite lacks FTS4 support (GH-129913) #129918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Lib/test/test_sqlite3/test_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from .util import memory_database
from .util import MemoryDatabaseMixin
from .util import requires_virtual_table


class DumpTests(MemoryDatabaseMixin, unittest.TestCase):
Expand Down Expand Up @@ -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 = [
Expand Down
8 changes: 8 additions & 0 deletions Lib/test/test_sqlite3/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import sqlite3
import test.support
import unittest


# Helper for temporary memory databases
Expand Down Expand Up @@ -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