Skip to content

Commit 4617152

Browse files
committed
Fixed test failures
1 parent bc8b6bd commit 4617152

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

tests/conftest.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,23 @@
1919
from blockbuster import BlockBuster
2020

2121
uvloop_marks = []
22+
uvloop_name = "uvloop"
2223
try:
2324
if platform.system() == "Windows":
25+
uvloop_name = "winloop"
2426
import winloop as uvloop
2527
else:
2628
import uvloop
2729
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"))
2931
uvloop = Mock()
3032
else:
3133
if hasattr(asyncio.AbstractEventLoop, "shutdown_default_executor") and not hasattr(
3234
uvloop.loop.Loop, "shutdown_default_executor"
3335
):
3436
uvloop_marks.append(
3537
pytest.mark.skip(
36-
reason=f"{uvloop.__name__} is missing shutdown_default_executor()"
38+
reason=f"{uvloop_name} is missing shutdown_default_executor()"
3739
)
3840
)
3941

@@ -47,7 +49,7 @@
4749
{"debug": True, "loop_factory": uvloop.new_event_loop},
4850
),
4951
marks=uvloop_marks,
50-
id=f"asyncio+{uvloop.__name__}",
52+
id=f"asyncio+{uvloop_name}",
5153
),
5254
]
5355
if sys.version_info >= (3, 12):
@@ -157,7 +159,7 @@ def no_other_refs() -> list[object]:
157159

158160

159161
@pytest.fixture
160-
def event_loop_implementation_name() -> str | None:
162+
async def event_loop_implementation_name() -> str | None:
161163
try:
162164
name = sniffio.current_async_library()
163165
except sniffio.AsyncLibraryNotFoundError:

0 commit comments

Comments
 (0)