Skip to content

Commit 9b83ae0

Browse files
committed
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
1 parent 83c5052 commit 9b83ae0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

sqlite_utils/recipes.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
from typing import Any, Callable, Optional
1+
from __future__ import annotations
2+
3+
from typing import TYPE_CHECKING
4+
5+
if TYPE_CHECKING:
6+
from typing import Any, Callable, Optional
27

38
from dateutil import parser
49
import json

tests/test_docs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def test_convert_help():
4141
result = CliRunner().invoke(cli.cli, ["convert", "--help"])
4242
assert result.exit_code == 0
4343
for expected in (
44-
"r.jsonsplit(value, ",
45-
"r.parsedate(value, ",
46-
"r.parsedatetime(value, ",
44+
"r.jsonsplit(value:",
45+
"r.parsedate(value:",
46+
"r.parsedatetime(value:",
4747
):
4848
assert expected in result.output
4949

0 commit comments

Comments
 (0)