INNER CODE UNIT · Python

engine

dialoguemd/fastapi-sqla · fastapi_sqla/_pytest_plugin.py:60

def engine(db_url: str) -> Engine:
    return create_engine(db_url)


@fixture(scope="session")
def sqla_connection(engine: Engine) -> Generator[Connection]:
    with engine.connect() as connection:
        yield connection


@fixture(scope="session")
def alembic_ini_path() -> str:  # pragma: no cover
    """Path for alembic.ini file, defaults to `./alembic.ini`."""
    return "./alembic.ini"


@fixture(scope="session")
def db_migration(db_url: str, sqla_connection: Connection, alembic_ini_path: str):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…