File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 19
19
from blockbuster import BlockBuster
20
20
21
21
uvloop_marks = []
22
+ uvloop_name = "uvloop"
22
23
try :
23
24
if platform .system () == "Windows" :
25
+ uvloop_name = "winloop"
24
26
import winloop as uvloop
25
27
else :
26
28
import uvloop
27
29
except ImportError :
28
- uvloop_marks .append (pytest .mark .skip (reason = "uvloop not available" ))
30
+ uvloop_marks .append (pytest .mark .skip (reason = f" { uvloop_name } not available" ))
29
31
uvloop = Mock ()
30
32
else :
31
33
if hasattr (asyncio .AbstractEventLoop , "shutdown_default_executor" ) and not hasattr (
32
34
uvloop .loop .Loop , "shutdown_default_executor"
33
35
):
34
36
uvloop_marks .append (
35
37
pytest .mark .skip (
36
- reason = f"{ uvloop . __name__ } is missing shutdown_default_executor()"
38
+ reason = f"{ uvloop_name } is missing shutdown_default_executor()"
37
39
)
38
40
)
39
41
47
49
{"debug" : True , "loop_factory" : uvloop .new_event_loop },
48
50
),
49
51
marks = uvloop_marks ,
50
- id = f"asyncio+{ uvloop . __name__ } " ,
52
+ id = f"asyncio+{ uvloop_name } " ,
51
53
),
52
54
]
53
55
if sys .version_info >= (3 , 12 ):
@@ -157,7 +159,7 @@ def no_other_refs() -> list[object]:
157
159
158
160
159
161
@pytest .fixture
160
- def event_loop_implementation_name () -> str | None :
162
+ async def event_loop_implementation_name () -> str | None :
161
163
try :
162
164
name = sniffio .current_async_library ()
163
165
except sniffio .AsyncLibraryNotFoundError :
You can’t perform that action at this time.
0 commit comments