-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add currently-failing static analysis test files
- Loading branch information
Showing
33 changed files
with
1,002 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_args_any_any.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_args_any_any.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(*args: Any) -> Any: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_args_any_str.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_args_any_str.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(*args: Any) -> str: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_args_int_any.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_args_int_any.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(*args: int) -> Any: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_kwargs_any_any.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_kwargs_any_any.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(**kwargs: Any) -> Any: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(x=1, y=2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_kwargs_any_str.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_kwargs_any_str.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(**kwargs: Any) -> str: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(x=1, y=2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_kwargs_int_any.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_kwargs_int_any.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(**kwargs: int) -> Any: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(x=1, y=2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_param_any_any.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_param_any_any.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(x: Any, y: Any) -> Any: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_param_any_str.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_param_any_str.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(x: Any, y: Any) -> str: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
30 changes: 30 additions & 0 deletions
30
test/static_analysis/aioretry_built_direct_async_param_int_any.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'''Test aioretry_built_direct_async_param_int_any.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
@Retry(exceptions=(ValueError, NotImplementedError), context=Context(tries=5, delay=2)).aioretry | ||
async def func(x: int, y: int) -> Any: | ||
''' ... ''' | ||
return 'return_value' | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await func(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
31 changes: 31 additions & 0 deletions
31
test/static_analysis/aioretry_main_by_call_named_sync_args_any_str.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'''Test aioretry_main_by_call_named_sync_args_any_str.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
def func(*args: Any) -> str: | ||
''' ... ''' | ||
return 'return_value' | ||
|
||
wrapped: Callable[[VarArg(Any)], Awaitable[str]] = aioretry(exceptions=Exception, tries=2)(func) | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await wrapped(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
31 changes: 31 additions & 0 deletions
31
test/static_analysis/aioretry_main_by_call_named_sync_args_int_str.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'''Test aioretry_main_by_call_named_sync_args_int_str.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
def func(*args: int) -> str: | ||
''' ... ''' | ||
return 'return_value' | ||
|
||
wrapped: Callable[[VarArg(int)], Awaitable[str]] = aioretry(exceptions=Exception, tries=2)(func) | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await wrapped(1, 2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
31 changes: 31 additions & 0 deletions
31
test/static_analysis/aioretry_main_by_call_named_sync_kwargs_any_str.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'''Test aioretry_main_by_call_named_sync_kwargs_any_str.py ''' | ||
|
||
# pylint: disable=unused-import, unused-argument, invalid-name, R0801 | ||
|
||
|
||
import asyncio | ||
from typing import Any | ||
from collections.abc import Callable, Awaitable | ||
from mypy_extensions import VarArg, KwArg | ||
from kaioretry import retry, aioretry, Retry, Context | ||
|
||
|
||
def func(**kwargs: Any) -> str: | ||
''' ... ''' | ||
return 'return_value' | ||
|
||
wrapped: Callable[[KwArg(Any)], Awaitable[str]] = aioretry(exceptions=Exception, tries=2)(func) | ||
from typing_extensions import reveal_type | ||
reveal_type(func) | ||
|
||
|
||
|
||
async def use_decoration(parameter: str) -> str: | ||
''' obtain result and use it ''' | ||
result = await wrapped(x=1, y=2) | ||
assert isinstance(result, str) | ||
return f"parameter is {parameter}. result is {result}" | ||
|
||
|
||
if __name__ == "__main__": | ||
print(asyncio.run(use_decoration("value"))) |
Oops, something went wrong.