"""Misc db_helper methods.""" from tests.integration.conftest import db_art_relations_connector def check_db_empty(compare_func, table='ledger_accounting_run_balance'): """Check whether table is empty.""" cnx = db_art_relations_connector() cursor = cnx.cursor() cursor.execute('SELECT * FROM {}'.format(table)) cursor.fetchall() rc = cursor.rowcount assert compare_func(rc, 0) cursor.close() cnx.close()