Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /MTSWebServices_data-rentgen /tests /fixtures /async_engine.py
| from __future__ import annotations | |
| import contextlib | |
| from typing import TYPE_CHECKING | |
| import pytest_asyncio | |
| from sqlalchemy.ext.asyncio import create_async_engine | |
| if TYPE_CHECKING: | |
| from collections.abc import AsyncGenerator | |
| from sqlalchemy.ext.asyncio import AsyncEngine | |
| from data_rentgen.db.settings import DatabaseSettings | |
| async def get_async_engine(db_settings: DatabaseSettings) -> AsyncGenerator[AsyncEngine, None]: | |
| """Create test engine""" | |
| connection_url = str(db_settings.url) | |
| engine = create_async_engine(connection_url) | |
| yield engine | |
| await engine.dispose() | |
| async def async_engine(db_settings: DatabaseSettings): | |
| async with get_async_engine(db_settings) as result: | |
| yield result | |
Xet Storage Details
- Size:
- 811 Bytes
- Xet hash:
- 431124b16a107b312a4d7efb42caf2533382f4eddcd5629b187ac27af446a1d2
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.