make database import unit tests against real SQL

This commit is contained in:
Sarah Hoffmann
2026-02-15 21:38:38 +01:00
parent d0bd42298e
commit c31abf58d0
2 changed files with 47 additions and 48 deletions

View File

@@ -145,11 +145,12 @@ def country_row(country_table, temp_db_cursor):
@pytest.fixture
def load_sql(temp_db_conn, country_row):
proc = SQLPreprocessor(temp_db_conn, Configuration(None))
def load_sql(temp_db_conn, country_table):
conf = Configuration(None)
def _run(filename, **kwargs):
proc.run_sql_file(temp_db_conn, filename, **kwargs)
def _run(*filename, **kwargs):
for fn in filename:
SQLPreprocessor(temp_db_conn, conf).run_sql_file(temp_db_conn, fn, **kwargs)
return _run