from nominatim.db.connection import connect
from nominatim.tools.refresh import _get_standard_function_sql, _get_partition_function_sql
-SQL_DIR = (Path(__file__) / '..' / '..' / '..' / 'sql').resolve()
+SQL_DIR = (Path(__file__) / '..' / '..' / '..' / 'lib-sql').resolve()
@pytest.fixture
def db(temp_db):
- conn = connect('dbname=' + temp_db)
- yield conn
- conn.close()
+ with connect('dbname=' + temp_db) as conn:
+ yield conn
@pytest.fixture
def db_with_tables(db):