]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/test_tools_refresh_create_functions.py
introduce table for in-database properties
[nominatim.git] / test / python / test_tools_refresh_create_functions.py
index d219d74864f4af628e40c9a66738213ecd854ad4..ac2f221126f79c4da85249a8e5facb9c7bcd6f68 100644 (file)
@@ -11,9 +11,8 @@ 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):