Skip to content

Commit d42a794

Browse files
🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
1 parent 7020e39 commit d42a794

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

src/fastapi_cli/cli.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import logging
22
from pathlib import Path
3-
from typing import Any, List, Union
3+
from typing import Annotated, Any, List, Union
44

55
import typer
66
from pydantic import ValidationError
77
from rich import print
88
from rich.tree import Tree
9-
from typing_extensions import Annotated
109

1110
from fastapi_cli.config import FastAPIConfig
1211
from fastapi_cli.discover import get_import_data, get_import_data_from_import_string

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from typing import Generator
2+
from collections.abc import Generator
33

44
import pytest
55
from typer import rich_utils

tests/test_cli_pyproject.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414

1515
def test_dev_with_pyproject_app_config_uses() -> None:
16-
with changing_dir(assets_path / "pyproject_config"), patch.object(
17-
uvicorn, "run"
18-
) as mock_run:
16+
with (
17+
changing_dir(assets_path / "pyproject_config"),
18+
patch.object(uvicorn, "run") as mock_run,
19+
):
1920
result = runner.invoke(app, ["dev"])
2021
assert result.exit_code == 0, result.output
2122

@@ -28,9 +29,10 @@ def test_dev_with_pyproject_app_config_uses() -> None:
2829

2930

3031
def test_run_with_pyproject_app_config() -> None:
31-
with changing_dir(assets_path / "pyproject_config"), patch.object(
32-
uvicorn, "run"
33-
) as mock_run:
32+
with (
33+
changing_dir(assets_path / "pyproject_config"),
34+
patch.object(uvicorn, "run") as mock_run,
35+
):
3436
result = runner.invoke(app, ["run"])
3537
assert result.exit_code == 0, result.output
3638

@@ -43,9 +45,10 @@ def test_run_with_pyproject_app_config() -> None:
4345

4446

4547
def test_cli_arg_overrides_pyproject_config() -> None:
46-
with changing_dir(assets_path / "pyproject_config"), patch.object(
47-
uvicorn, "run"
48-
) as mock_run:
48+
with (
49+
changing_dir(assets_path / "pyproject_config"),
50+
patch.object(uvicorn, "run") as mock_run,
51+
):
4952
result = runner.invoke(app, ["dev", "another_module.py"])
5053

5154
assert result.exit_code == 0, result.output

tests/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import os
2+
from collections.abc import Generator
23
from contextlib import contextmanager
34
from pathlib import Path
4-
from typing import Generator, Union
5+
from typing import Union
56

67

78
@contextmanager

0 commit comments

Comments
 (0)