Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirVondukr committed Nov 22, 2024
1 parent 886755a commit ac0cf44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion tests/ext/fastapi/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ async def route_with_depends(
) -> dict[str, str | int]:
return {"value": number}


@app_.get("/raise-exception")
@inject
async def raises_exception(
Expand Down
7 changes: 3 additions & 4 deletions tests/ext/fastapi/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from _pytest.fixtures import SubRequest

import aioinject
from aioinject import Scoped, Transient, Singleton
from aioinject import Scoped, Singleton, Transient
from tests.ext.utils import ExceptionPropagation, PropagatedError


Expand Down Expand Up @@ -37,6 +37,7 @@ async def test_function_route_override(
assert response.status_code == httpx.codes.OK.value
assert response.json() == {"value": expected}


@pytest.mark.parametrize(
("provider_type", "should_propagate"),
[
Expand All @@ -48,16 +49,14 @@ async def test_function_route_override(
async def test_propagation(
http_client: httpx.AsyncClient,
container: aioinject.Container,
route: str,
provider_type: Any,
should_propagate: bool,
) -> None:
propagation = ExceptionPropagation()

with (
container.override(provider_type(propagation.dependency, type_=int)), # type: ignore[call-arg]
container.override(provider_type(propagation.dependency, type_=int)),
contextlib.suppress(Exception),

):
await http_client.get("/raise-exception")

Expand Down

0 comments on commit ac0cf44

Please sign in to comment.