X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/6a7e0d652b1d40a397e1c1386d500101796676c4..a33f2c0f5ba43df533b6e137f9151fe67feb20a1:/test/python/test_tools_admin.py?ds=sidebyside diff --git a/test/python/test_tools_admin.py b/test/python/test_tools_admin.py index a40a17db..36c7d6ff 100644 --- a/test/python/test_tools_admin.py +++ b/test/python/test_tools_admin.py @@ -9,9 +9,8 @@ from nominatim.tools import admin @pytest.fixture def db(temp_db, placex_table): - conn = connect('dbname=' + temp_db) - yield conn - conn.close() + with connect('dbname=' + temp_db) as conn: + yield conn def test_analyse_indexing_no_objects(db): with pytest.raises(UsageError):