55import pytest
66
77import python_utils
8+ from python_utils import types
89
910
1011@pytest .mark .parametrize (
2526)
2627@pytest .mark .asyncio
2728async def test_aio_timeout_generator (
28- timeout , interval , interval_multiplier , maximum_interval , iterable , result
29+ timeout : float ,
30+ interval : float ,
31+ interval_multiplier : float ,
32+ maximum_interval : float ,
33+ iterable : types .AsyncIterable [types .Any ],
34+ result : int ,
2935):
3036 i = None
3137 async for i in python_utils .aio_timeout_generator (
@@ -40,21 +46,30 @@ async def test_aio_timeout_generator(
4046 'timeout,interval,interval_multiplier,maximum_interval,iterable,result' ,
4147 [
4248 (0.01 , 0.006 , 0.5 , 0.01 , 'abc' , 'c' ),
43- (0.01 , 0.006 , 0.5 , 0.01 , itertools .count , 2 ),
49+ (0.01 , 0.006 , 0.5 , 0.01 , itertools .count , 2 ), # type: ignore
4450 (0.01 , 0.006 , 0.5 , 0.01 , itertools .count (), 2 ),
4551 (0.01 , 0.006 , 1.0 , None , 'abc' , 'c' ),
4652 (
4753 timedelta (seconds = 0.01 ),
4854 timedelta (seconds = 0.006 ),
4955 2.0 ,
5056 timedelta (seconds = 0.01 ),
51- itertools .count ,
57+ itertools .count , # type: ignore
5258 2 ,
5359 ),
5460 ],
5561)
5662def test_timeout_generator (
57- timeout , interval , interval_multiplier , maximum_interval , iterable , result
63+ timeout : float ,
64+ interval : float ,
65+ interval_multiplier : float ,
66+ maximum_interval : float ,
67+ iterable : types .Union [
68+ str ,
69+ types .Iterable [types .Any ],
70+ types .Callable [..., types .Iterable [types .Any ]],
71+ ],
72+ result : int ,
5873):
5974 i = None
6075 for i in python_utils .timeout_generator (
0 commit comments