agent0.chainsync.test_fixtures.db_session ========================================= .. py:module:: agent0.chainsync.test_fixtures.db_session .. autoapi-nested-parse:: Create an in memory db session and creates the base db schema. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: agent0.chainsync.test_fixtures.db_session.TEST_POSTGRES_NAME Functions --------- .. autoapisummary:: agent0.chainsync.test_fixtures.db_session.psql_docker agent0.chainsync.test_fixtures.db_session.database_engine agent0.chainsync.test_fixtures.db_session.db_session Module Contents --------------- .. py:data:: TEST_POSTGRES_NAME :value: 'postgres_test' .. py:function:: psql_docker() -> Iterator[agent0.chainsync.PostgresConfig] Test fixture for running postgres in docker. :Yields: *PostgresConfig* -- The PostgresConfig. .. !! processed by numpydoc !! .. py:function:: database_engine(psql_docker: agent0.chainsync.PostgresConfig) -> Iterator[sqlalchemy.Engine] Create psql engine on local postgres container. :param psql_docker: The PostgresConfig object returned by the `psql_docker` test fixture. :type psql_docker: PostgresConfig :Yields: *Engine* -- The sqlalchemy engine. .. !! processed by numpydoc !! .. py:function:: db_session(database_engine: sqlalchemy.Engine) -> Iterator[sqlalchemy.orm.Session] Initialize the in memory db session and creates the db schema. :param database_engine: The sqlalchemy database engine returned from the `database_engine` test fixture. :type database_engine: Engine :Yields: *Session* -- The sqlalchemy session object. .. !! processed by numpydoc !!