diff --git a/backend/tests/e2e/conftest.py b/backend/tests/e2e/conftest.py index 0035f7c..2b109ab 100644 --- a/backend/tests/e2e/conftest.py +++ b/backend/tests/e2e/conftest.py @@ -122,9 +122,9 @@ def async_postgres_url(postgres_url) -> str: Testcontainers returns postgresql+psycopg2:// format. """ # Testcontainers uses psycopg2 by default, convert to asyncpg - return postgres_url.replace("postgresql+psycopg2://", "postgresql+asyncpg://").replace( - "postgresql://", "postgresql+asyncpg://" - ) + return postgres_url.replace( + "postgresql+psycopg2://", "postgresql+asyncpg://" + ).replace("postgresql://", "postgresql+asyncpg://") @pytest_asyncio.fixture diff --git a/backend/tests/e2e/test_api_contracts.py b/backend/tests/e2e/test_api_contracts.py index 093f92d..771cdeb 100644 --- a/backend/tests/e2e/test_api_contracts.py +++ b/backend/tests/e2e/test_api_contracts.py @@ -15,8 +15,8 @@ Note: Schemathesis v4.x API - filtering is done via include/exclude methods. import pytest try: + from hypothesis import settings from schemathesis import openapi - from hypothesis import Phase, settings SCHEMATHESIS_AVAILABLE = True except ImportError: diff --git a/backend/tests/e2e/test_database_workflows.py b/backend/tests/e2e/test_database_workflows.py index 3b012e2..f2ed713 100644 --- a/backend/tests/e2e/test_database_workflows.py +++ b/backend/tests/e2e/test_database_workflows.py @@ -40,7 +40,9 @@ class TestUserRegistrationWorkflow: }, ) - assert response.status_code in [200, 201], f"Registration failed: {response.text}" + assert response.status_code in [200, 201], ( + f"Registration failed: {response.text}" + ) data = response.json() assert data["email"] == email assert "id" in data @@ -93,7 +95,9 @@ class TestAuthenticationWorkflow: "last_name": "Test", }, ) - assert reg_resp.status_code in [200, 201], f"Registration failed: {reg_resp.text}" + assert reg_resp.status_code in [200, 201], ( + f"Registration failed: {reg_resp.text}" + ) # 2. Login login_resp = await e2e_client.post(