File tree 2 files changed +10
-4
lines changed
tests/test_primitives/test_reawaitable
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 5
5
# Try to use anyio.Lock, fall back to asyncio.Lock
6
6
try :
7
7
import anyio
8
+
8
9
Lock = anyio .Lock
9
10
except ImportError :
10
11
import asyncio
12
+
11
13
Lock = asyncio .Lock
12
14
13
15
_ValueType = TypeVar ('_ValueType' )
Original file line number Diff line number Diff line change 8
8
# https://github.com/dry-python/returns/issues/2108
9
9
async def sample_coro () -> str :
10
10
"""Sample coroutine that simulates an async operation."""
11
- await anyio .sleep (1 ) # Increased from 0.1 to reduce chance of random failures
11
+ await anyio .sleep (
12
+ 1
13
+ ) # Increased from 0.1 to reduce chance of random failures
12
14
return 'done'
13
15
14
16
@@ -32,8 +34,10 @@ async def test_reawaitable_decorator() -> None:
32
34
"""Test the reawaitable decorator with concurrent awaits."""
33
35
34
36
async def test_coro () -> str : # noqa: WPS430
35
- await anyio .sleep (1 ) # Increased from 0.1 to reduce chance of random failures
36
- return "decorated"
37
+ await anyio .sleep (
38
+ 1
39
+ ) # Increased from 0.1 to reduce chance of random failures
40
+ return 'decorated'
37
41
38
42
decorated = reawaitable (test_coro )
39
43
instance = decorated ()
@@ -42,7 +46,7 @@ async def test_coro() -> str: # noqa: WPS430
42
46
result1 = await instance
43
47
result2 = await instance
44
48
45
- assert result1 == " decorated"
49
+ assert result1 == ' decorated'
46
50
assert result1 == result2
47
51
48
52
# Test concurrent awaits
You can’t perform that action at this time.
0 commit comments