Refactor E2E tests and fixtures for improved readability and consistency
- Reformatted assertions in `test_database_workflows.py` for better readability. - Refactored `postgres_url` transformation logic in `conftest.py` for improved clarity. - Adjusted import handling in `test_api_contracts.py` to streamline usage of Hypothesis and Schemathesis libraries.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user