X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/b9517c99ae6297c2ab908d7fa324efd2d1b2f43a..dd03aeb966c2a101759d447a0fa00340812c89da:/test/python/test_tools_refresh_create_functions.py?ds=sidebyside diff --git a/test/python/test_tools_refresh_create_functions.py b/test/python/test_tools_refresh_create_functions.py index d219d748..ac2f2211 100644 --- a/test/python/test_tools_refresh_create_functions.py +++ b/test/python/test_tools_refresh_create_functions.py @@ -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):