Skip to content

Commit bd8a351

Browse files
committed
fixed tests
1 parent 141e4d8 commit bd8a351

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

services/web/server/tests/unit/with_dbs/02/test_projects_states_handlers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ async def test_project_node_lifetime( # noqa: PLR0915
12151215
@pytest.fixture
12161216
async def client_on_running_server_factory(
12171217
client: TestClient,
1218-
) -> AsyncIterator[Callable]:
1218+
) -> AsyncIterator[Callable[[], TestClient]]:
12191219
# Creates clients connected to the same server as the reference client
12201220
#
12211221
# Implemented as aihttp_client but creates a client using a running server,
@@ -1225,7 +1225,7 @@ async def client_on_running_server_factory(
12251225

12261226
clients = []
12271227

1228-
def go():
1228+
def go() -> TestClient:
12291229
cli = TestClient(client.server, loop=asyncio.get_event_loop())
12301230
assert client.server.started
12311231
# AVOIDS client.start_server
@@ -1234,7 +1234,7 @@ def go():
12341234

12351235
yield go
12361236

1237-
async def close_client_but_not_server(cli: TestClient):
1237+
async def close_client_but_not_server(cli: TestClient) -> None:
12381238
# pylint: disable=protected-access
12391239
if not cli._closed: # noqa: SLF001
12401240
for resp in cli._responses: # noqa: SLF001
@@ -1259,7 +1259,7 @@ def clean_redis_table(redis_client) -> None:
12591259
@pytest.mark.parametrize(*standard_role_response())
12601260
async def test_open_shared_project_2_users_locked(
12611261
client: TestClient,
1262-
client_on_running_server_factory: Callable,
1262+
client_on_running_server_factory: Callable[[], TestClient],
12631263
logged_user: dict,
12641264
shared_project: dict,
12651265
socketio_client_factory: Callable,
@@ -1279,7 +1279,7 @@ async def test_open_shared_project_2_users_locked(
12791279

12801280
client_1 = client
12811281
client_id1 = client_session_id_factory()
1282-
client_2 = await client_on_running_server_factory()
1282+
client_2 = client_on_running_server_factory()
12831283
client_id2 = client_session_id_factory()
12841284

12851285
# 1. user 1 opens project
@@ -1442,7 +1442,7 @@ async def test_open_shared_project_2_users_locked(
14421442
@pytest.mark.parametrize(*standard_role_response())
14431443
async def test_open_shared_project_at_same_time(
14441444
client: TestClient,
1445-
client_on_running_server_factory: Callable,
1445+
client_on_running_server_factory: Callable[[], TestClient],
14461446
logged_user: dict,
14471447
shared_project: ProjectDict,
14481448
socketio_client_factory: Callable,
@@ -1471,7 +1471,7 @@ async def test_open_shared_project_at_same_time(
14711471
]
14721472
# create other clients
14731473
for _i in range(NUMBER_OF_ADDITIONAL_CLIENTS):
1474-
new_client = await client_on_running_server_factory()
1474+
new_client = client_on_running_server_factory()
14751475
user = await log_client_in(
14761476
new_client,
14771477
{"role": user_role.name},

0 commit comments

Comments
 (0)