From 9b83ae0325e67d4f5ac31c885516fde717b9c22f Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 15 Dec 2025 19:28:45 +0000 Subject: [PATCH] Fix test failures caused by type hint changes - Use TYPE_CHECKING guard in recipes.py to prevent typing imports from appearing in module namespace (fixes test_recipes_are_documented) - Update test_convert_help to check for function names with type hints in a more flexible way --- sqlite_utils/recipes.py | 7 ++++++- tests/test_docs.py | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/sqlite_utils/recipes.py b/sqlite_utils/recipes.py index 1d85662..821bed0 100644 --- a/sqlite_utils/recipes.py +++ b/sqlite_utils/recipes.py @@ -1,4 +1,9 @@ -from typing import Any, Callable, Optional +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Any, Callable, Optional from dateutil import parser import json diff --git a/tests/test_docs.py b/tests/test_docs.py index a36b053..fb1d8ae 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -41,9 +41,9 @@ def test_convert_help(): result = CliRunner().invoke(cli.cli, ["convert", "--help"]) assert result.exit_code == 0 for expected in ( - "r.jsonsplit(value, ", - "r.parsedate(value, ", - "r.parsedatetime(value, ", + "r.jsonsplit(value:", + "r.parsedate(value:", + "r.parsedatetime(value:", ): assert expected in result.output