tests/_helpers.py
def insert_into_table(db_conn, field_names_list, field_values_list, table_name):
    """Helper function to insert into a table given a tbl_name, tbl_field_names and tbl_field_values."""
    with db_conn, db_conn.cursor() as cursor:
        execute_values(cursor, """INSERT INTO {tbl_name}({field_names_list})
                                       VALUES %s""".format(tbl_name=table_name,
                                                           field_names_list=', '.join(field_names_list)),
                       field_values_list)
Helper function to insert into a table given a tbl_name, tbl_field_names and tbl_field_values.
Helper function to insert into a table given a tbl_name, tbl_field_names and tbl_field_values.
Helper function to insert into a table given a tbl_name tbl_field_names and tbl_field_values .
def insert_into_table(db_conn, field_names_list, field_values_list, table_name):
    with db_conn, db_conn.cursor() as cursor:
        execute_values(cursor, """INSERT INTO {tbl_name}({field_names_list})
                                       VALUES %s""".format(tbl_name=table_name,
                                                           field_names_list=', '.join(field_names_list)),
                       field_values_list)
def insert_into_table ( db_conn , field_names_list , field_values_list , table_name ) : with db_conn , db_conn . cursor ( ) as cursor : execute_values ( cursor , """INSERT INTO {tbl_name}({field_names_list})
                                       VALUES %s""" . format ( tbl_name = table_name , field_names_list = ', ' . join ( field_names_list ) ) , field_values_list )
Helper function to insert into a table given a tbl_name, tbl_field_names and tbl_field_values.
Helper function to insert into a table given a tbl_name tbl_field_names and tbl_field_values .
"""Helper function to insert into a table given a tbl_name, tbl_field_names and tbl_field_values."""
db_conn
field_names_list
field_values_list
table_name