Skip to content

Commit 8307a0b

Browse files
committed
move protocol and eventloop fixtures to module scope, call shutdown at protocol fixture
1 parent 5264b7f commit 8307a0b

File tree

1 file changed

+5
-3
lines changed
  • tests/robotcode/language_server/robotframework

1 file changed

+5
-3
lines changed

tests/robotcode/language_server/robotframework/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@
2929
from tests.robotcode.language_server.robotframework.tools import generate_test_id
3030

3131

32-
@pytest.fixture(scope="function")
32+
@pytest.fixture(scope="module")
3333
def event_loop() -> Generator[asyncio.AbstractEventLoop, None, None]:
3434
loop = asyncio.new_event_loop()
35+
loop.set_debug(True)
3536
try:
3637
yield loop
3738
finally:
3839
loop.close()
3940

4041

41-
@pytest.fixture(scope="function", ids=generate_test_id)
42+
@pytest.fixture(scope="module", ids=generate_test_id)
4243
@pytest.mark.usefixtures("event_loop")
4344
async def protocol(request: Any) -> AsyncGenerator[RobotLanguageServerProtocol, None]:
4445
root_path = Path().resolve()
@@ -81,6 +82,7 @@ async def protocol(request: Any) -> AsyncGenerator[RobotLanguageServerProtocol,
8182
)
8283
yield protocol
8384
finally:
85+
await protocol._shutdown()
8486
server.close()
8587

8688

@@ -96,5 +98,5 @@ async def test_document(request: Any) -> AsyncGenerator[TextDocument, None]:
9698
try:
9799
yield document
98100
finally:
99-
# del document
101+
del document
100102
pass

0 commit comments

Comments
 (0)