tests/_fixtures.py
def metadata_db_conn(postgres, mocked_config):
    """Fixture to inject a metadata DB connection as a fixture. Only cleans up the job_metadata table."""
    # Create db connection
    conn = create_db_connection(mocked_config.db_config, autocommit=True)
    yield conn
    with conn.cursor() as cursor:
        cursor.execute('TRUNCATE job_metadata')
        cursor.execute('ALTER SEQUENCE job_metadata_run_id_seq RESTART WITH 1')
    conn.close()
Fixture to inject a metadata DB connection as a fixture. Only cleans up the job_metadata table.
Fixture to inject a metadata DB connection as a fixture. Only cleans up the job_metadata table.
Fixture to inject a metadata DB connection as a fixture . Only cleans up the job_metadata table .
def metadata_db_conn(postgres, mocked_config):
    conn = create_db_connection(mocked_config.db_config, autocommit=True)
    yield conn
    with conn.cursor() as cursor:
        cursor.execute('TRUNCATE job_metadata')
        cursor.execute('ALTER SEQUENCE job_metadata_run_id_seq RESTART WITH 1')
    conn.close()
def metadata_db_conn ( postgres , mocked_config ) : conn = create_db_connection ( mocked_config . db_config , autocommit = True ) yield conn with conn . cursor ( ) as cursor : cursor . execute ( 'TRUNCATE job_metadata' ) cursor . execute ( 'ALTER SEQUENCE job_metadata_run_id_seq RESTART WITH 1' ) conn . close ( )
Fixture to inject a metadata DB connection as a fixture.
Fixture to inject a metadata DB connection as a fixture .
"""Fixture to inject a metadata DB connection as a fixture. Only cleans up the job_metadata table.""" # Create db connection
postgres
mocked_config