File tree 1 file changed +7
-6
lines changed
tests/test_primitives/test_reawaitable 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ async def test_concurrent_awaitable():
15
15
16
16
async def await_reawaitable ():
17
17
return await test_target
18
+
18
19
async with anyio .create_task_group () as tg :
19
20
task1 = tg .start_soon (await_reawaitable )
20
21
task2 = tg .start_soon (await_reawaitable )
@@ -27,15 +28,15 @@ async def test_reawaitable_decorator():
27
28
@reawaitable
28
29
async def decorated_coro ():
29
30
await anyio .sleep (0.1 )
30
- return " decorated"
31
+ return ' decorated'
31
32
32
33
instance = decorated_coro ()
33
34
34
35
# Test multiple awaits
35
36
result1 = await instance
36
37
result2 = await instance
37
38
38
- assert result1 == " decorated"
39
+ assert result1 == ' decorated'
39
40
assert result1 == result2
40
41
41
42
# Test concurrent awaits
@@ -50,15 +51,15 @@ async def await_decorated():
50
51
@pytest .mark .anyio
51
52
async def test_reawaitable_repr ():
52
53
"""Test the __repr__ method of ReAwaitable."""
53
-
54
+
54
55
async def test_func ():
55
56
return 1
56
-
57
+
57
58
coro = test_func ()
58
59
reawaitable = ReAwaitable (coro )
59
-
60
+
60
61
# Test the representation
61
62
assert repr (reawaitable ) == repr (coro )
62
-
63
+
63
64
# Ensure the coroutine is properly awaited
64
65
await reawaitable
You can’t perform that action at this time.
0 commit comments