Skip to content

Commit 988157e

Browse files
committed
test with WindowsSelectorEventLoopPolicy
1 parent 5fec21a commit 988157e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unit/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
from __future__ import annotations
55

6+
import asyncio
67
import logging
78
import os
9+
import sys
810
from typing import TYPE_CHECKING, cast
911

1012
import pytest
@@ -28,6 +30,10 @@
2830
from crawlee.http_clients._base import HttpClient
2931

3032

33+
if sys.platform == 'win32' and sys.version_info >= (3, 12):
34+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
35+
36+
3137
@pytest.fixture
3238
def prepare_test_env(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Callable[[], None]:
3339
"""Prepare the testing environment by resetting the global state before each test.

0 commit comments

Comments
 (0)