Skip to content

Commit

Permalink
chore: #115 pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Sep 5, 2024
1 parent 0c1ec53 commit f56d11b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/async/test_depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,15 @@ async def another_func(

assert await some_func("1", "2")
assert await another_func("3") == 6.0


@pytest.mark.anyio
async def test_default_key_value():
async def dep(a: str = "a"):
return a

@inject(cast=False)
async def func(a=Depends(dep)):
return a

assert await func() == "a"
11 changes: 11 additions & 0 deletions tests/sync/test_depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,3 +376,14 @@ def another_func(

assert some_func("1", "2")
assert another_func("3") == 6.0


def test_default_key_value():
def dep(a: str = "a"):
return a

@inject(cast=False)
def func(a=Depends(dep)):
return a

assert func() == "a"

0 comments on commit f56d11b

Please sign in to comment.