mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
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
This commit is contained in:
parent
83c50527aa
commit
9b83ae0325
2 changed files with 9 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue