Skip to content

Commit a32cb9b

Browse files
committed
use pytest_asyncio.fixture for aync fixtures
1 parent 3353050 commit a32cb9b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ junit_suite_name = "robotcode"
107107
log_cli = true
108108
log_cli_level = "DEBUG"
109109
log_cli_format = "%(levelname)s %(name)s: %(message)s"
110+
asyncio_mode="auto"
110111

111112
[tool.isort]
112113
profile = "black"

tests/robotcode/language_server/robotframework/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import Any, AsyncGenerator, Generator, cast
55

66
import pytest
7+
import pytest_asyncio
78

89
from robotcode.language_server.common.lsp_types import (
910
ClientCapabilities,
@@ -39,7 +40,7 @@ def event_loop() -> Generator[asyncio.AbstractEventLoop, None, None]:
3940
loop.close()
4041

4142

42-
@pytest.fixture(scope="module", ids=generate_test_id)
43+
@pytest_asyncio.fixture(scope="module", ids=generate_test_id)
4344
@pytest.mark.usefixtures("event_loop")
4445
async def protocol(request: Any) -> AsyncGenerator[RobotLanguageServerProtocol, None]:
4546
root_path = Path().resolve()
@@ -86,7 +87,7 @@ async def protocol(request: Any) -> AsyncGenerator[RobotLanguageServerProtocol,
8687
server.close()
8788

8889

89-
@pytest.fixture(scope="function")
90+
@pytest_asyncio.fixture(scope="function")
9091
@pytest.mark.usefixtures("event_loop")
9192
async def test_document(request: Any) -> AsyncGenerator[TextDocument, None]:
9293
data_path = Path(request.param)
@@ -99,4 +100,3 @@ async def test_document(request: Any) -> AsyncGenerator[TextDocument, None]:
99100
yield document
100101
finally:
101102
del document
102-
pass

0 commit comments

Comments
 (0)