5
5
import pytest
6
6
7
7
import python_utils
8
+ from python_utils import types
8
9
9
10
10
11
@pytest .mark .parametrize (
25
26
)
26
27
@pytest .mark .asyncio
27
28
async 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 ,
29
35
):
30
36
i = None
31
37
async for i in python_utils .aio_timeout_generator (
@@ -40,21 +46,30 @@ async def test_aio_timeout_generator(
40
46
'timeout,interval,interval_multiplier,maximum_interval,iterable,result' ,
41
47
[
42
48
(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
44
50
(0.01 , 0.006 , 0.5 , 0.01 , itertools .count (), 2 ),
45
51
(0.01 , 0.006 , 1.0 , None , 'abc' , 'c' ),
46
52
(
47
53
timedelta (seconds = 0.01 ),
48
54
timedelta (seconds = 0.006 ),
49
55
2.0 ,
50
56
timedelta (seconds = 0.01 ),
51
- itertools .count ,
57
+ itertools .count , # type: ignore
52
58
2 ,
53
59
),
54
60
],
55
61
)
56
62
def 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 ,
58
73
):
59
74
i = None
60
75
for i in python_utils .timeout_generator (
0 commit comments