Skip to content

Commit c464edc

Browse files
committed
test: don't run the LS tests in another thread
1 parent 0076636 commit c464edc

File tree

7 files changed

+7
-22
lines changed

7 files changed

+7
-22
lines changed

tests/robotcode/language_server/robotframework/parts/test_discovering.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from robotcode.language_server.robotframework.protocol import (
99
RobotLanguageServerProtocol,
1010
)
11-
from robotcode.utils.async_tools import run_coroutine_in_thread
1211

1312
from .pytest_regtestex import RegTestFixtureEx
1413

@@ -39,10 +38,7 @@ def split(item: TestItem) -> TestItem:
3938
)
4039

4140
result = await asyncio.wait_for(
42-
run_coroutine_in_thread(
43-
protocol.robot_discovering.get_tests_from_workspace, Path(Path(__file__).parent, "data").as_uri()
44-
),
45-
120,
41+
protocol.robot_discovering.get_tests_from_workspace(Path(Path(__file__).parent, "data").as_uri()), 120
4642
)
4743
regtest.write(
4844
yaml.dump(

tests/robotcode/language_server/robotframework/parts/test_document_highlight.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from robotcode.language_server.robotframework.protocol import (
1111
RobotLanguageServerProtocol,
1212
)
13-
from robotcode.utils.async_tools import run_coroutine_in_thread
1413

1514
from ..tools import (
1615
GeneratedTestData,
@@ -35,8 +34,7 @@ async def test(
3534
data: GeneratedTestData,
3635
) -> None:
3736
result = await asyncio.wait_for(
38-
run_coroutine_in_thread(
39-
protocol.robot_document_highlight.collect,
37+
protocol.robot_document_highlight.collect(
4038
protocol.robot_document_highlight,
4139
test_document,
4240
Position(line=data.line, character=data.character),

tests/robotcode/language_server/robotframework/parts/test_foldingrange.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from robotcode.language_server.robotframework.protocol import (
1616
RobotLanguageServerProtocol,
1717
)
18-
from robotcode.utils.async_tools import run_coroutine_in_thread
1918

2019
from ..tools import (
2120
GeneratedTestData,
@@ -72,7 +71,7 @@ async def test(
7271
data: GeneratedTestData,
7372
) -> None:
7473
result = await asyncio.wait_for(
75-
run_coroutine_in_thread(protocol.robot_folding_ranges.collect, protocol.robot_folding_ranges, test_document), 60
74+
protocol.robot_folding_ranges.collect(protocol.robot_folding_ranges, test_document), 60
7675
)
7776

7877
regtest.write(yaml.dump({"data": data, "result": result}))

tests/robotcode/language_server/robotframework/parts/test_goto_definition.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from robotcode.language_server.robotframework.protocol import (
1111
RobotLanguageServerProtocol,
1212
)
13-
from robotcode.utils.async_tools import run_coroutine_in_thread
1413

1514
from ..tools import (
1615
GeneratedTestData,
@@ -36,8 +35,7 @@ async def test_definition(
3635
data: GeneratedTestData,
3736
) -> None:
3837
result = await asyncio.wait_for(
39-
run_coroutine_in_thread(
40-
protocol.robot_goto.collect_definition,
38+
protocol.robot_goto.collect_definition(
4139
protocol.robot_goto,
4240
test_document,
4341
Position(line=data.line, character=data.character),

tests/robotcode/language_server/robotframework/parts/test_goto_implementation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from robotcode.language_server.robotframework.protocol import (
1212
RobotLanguageServerProtocol,
1313
)
14-
from robotcode.utils.async_tools import run_coroutine_in_thread
1514
from robotcode.utils.uri import Uri
1615

1716
from ..tools import (
@@ -60,8 +59,7 @@ async def test_implementation(
6059
data: GeneratedTestData,
6160
) -> None:
6261
result = await asyncio.wait_for(
63-
run_coroutine_in_thread(
64-
protocol.robot_goto.collect_implementation,
62+
protocol.robot_goto.collect_implementation(
6563
protocol.robot_goto,
6664
test_document,
6765
Position(line=data.line, character=data.character),

tests/robotcode/language_server/robotframework/parts/test_hover.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from robotcode.language_server.robotframework.protocol import (
1212
RobotLanguageServerProtocol,
1313
)
14-
from robotcode.utils.async_tools import run_coroutine_in_thread
1514

1615
from ..tools import (
1716
GeneratedTestData,
@@ -47,8 +46,7 @@ async def test(
4746
data: GeneratedTestData,
4847
) -> None:
4948
result = await asyncio.wait_for(
50-
run_coroutine_in_thread(
51-
protocol.robot_hover.collect,
49+
protocol.robot_hover.collect(
5250
protocol.hover,
5351
test_document,
5452
Position(line=data.line, character=data.character),

tests/robotcode/language_server/robotframework/parts/test_references.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from robotcode.language_server.robotframework.protocol import (
1515
RobotLanguageServerProtocol,
1616
)
17-
from robotcode.utils.async_tools import run_coroutine_in_thread
1817

1918
from ..tools import (
2019
GeneratedTestData,
@@ -42,8 +41,7 @@ def split(location: Location) -> Location:
4241
return Location("/".join(location.uri.split("/")[-2:]), location.range)
4342

4443
result = await asyncio.wait_for(
45-
run_coroutine_in_thread(
46-
protocol.robot_references.collect,
44+
protocol.robot_references.collect(
4745
protocol.robot_references,
4846
test_document,
4947
Position(line=data.line, character=data.character),

0 commit comments

Comments
 (0)