Skip to content

Commit

Permalink
add mypy tests for named arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Anvil committed Dec 2, 2023
1 parent 84c6251 commit 8095870
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/static_analysis/33_main_retry_named_args.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Retry object, with __call__, no param"""

from kaioretry import retry

@retry(exceptions=Exception, tries=1)
def func(param1: int) -> float:
""" one of """
return 1 / param1


def func2(param2: int) -> float:
"""Anything using the first func"""
return 3 + func(param2)


if __name__ == "__main__":
assert func(1) == 1
18 changes: 18 additions & 0 deletions test/static_analysis/34_main_aioretry_named_args.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Retry object, with __call__, no param"""

import asyncio
from kaioretry import aioretry

@aioretry(exceptions=Exception, tries=1)
async def func(param1: int) -> float:
""" one of """
return 1 / param1


async def func2(param2: int) -> float:
"""Anything using the first func"""
return 3 + await func(param2)


if __name__ == "__main__":
assert asyncio.run(func(1)) == 1

0 comments on commit 8095870

Please sign in to comment.