fix(ci): explicitly pass client=('127.0.0.1', 50000) to ASGITransport in tests

This commit is contained in:
IgorVolochay
2026-08-25 17:59:48 +03:00
parent 05f9371aa8
commit 98f98fb8c1
4 changed files with 46 additions and 46 deletions
+8 -8
View File
@@ -18,7 +18,7 @@ NON_EXIST_USER = random.randint(100000000, 1000000000)
@pytest.mark.asyncio(loop_scope="session")
async def test_add_user_non_full_data():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/add_user"
data = {
@@ -32,7 +32,7 @@ async def test_add_user_non_full_data():
@pytest.mark.asyncio(loop_scope="session")
async def test_add_user_negative_int_id():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/add_user"
data = {
@@ -49,7 +49,7 @@ async def test_add_user_negative_int_id():
@pytest.mark.asyncio(loop_scope="session")
async def test_add_new_user():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/add_user"
data = {
@@ -69,7 +69,7 @@ async def test_add_new_user():
@pytest.mark.asyncio(loop_scope="session")
async def test_add_already_exist_user():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/add_user"
data = {
@@ -94,7 +94,7 @@ async def test_add_already_exist_user():
@pytest.mark.asyncio(loop_scope="session")
async def test_check_non_exist_user():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/check_user"
params = {"user_id": NON_EXIST_USER}
@@ -108,7 +108,7 @@ async def test_check_non_exist_user():
@pytest.mark.asyncio(loop_scope="session")
async def test_check_exist_user():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/check_user"
params = {"user_id": EXIST_USER}
@@ -127,7 +127,7 @@ async def test_check_exist_user():
@pytest.mark.asyncio(loop_scope="session")
async def test_get_non_exist_user():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/get_user"
params = {"user_id": NON_EXIST_USER}
@@ -141,7 +141,7 @@ async def test_get_non_exist_user():
@pytest.mark.asyncio(loop_scope="session")
async def test_get_exist_user():
async with AsyncClient(transport=ASGITransport(app=app),
async with AsyncClient(transport=ASGITransport(app=app, client=("127.0.0.1", 50000)),
base_url='http://test') as client:
end_point = "/get_user"
params = {"user_id": EXIST_USER}