From 85e7411bbd2884e42c65c3e93330f0ddd986be38 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Fri, 26 Aug 2022 22:01:58 -0700 Subject: [PATCH] Skip test if pragma_function_list not supported, refs #471 --- tests/test_cli.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/test_cli.py b/tests/test_cli.py index 057f129..9b43cd5 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -12,6 +12,15 @@ import textwrap from .utils import collapse_whitespace +def _supports_pragma_function_list(): + db = Database(memory=True) + try: + db.execute("select * from pragma_function_list()") + except Exception: + return False + return True + + @pytest.mark.parametrize( "options", ( @@ -753,6 +762,10 @@ def test_query_complex_function(db_path): ] +@pytest.mark.skipif( + not _supports_pragma_function_list(), + reason="Needs SQLite version that supports pragma_function_list()", +) def test_hidden_functions_are_hidden(db_path): result = CliRunner().invoke( cli.cli,