X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/101a1f895d25451535f5c186d2ce1f5b7e753e3b..af7226393a45a0ea5b87967c3231392b0e12da64:/test/python/conftest.py diff --git a/test/python/conftest.py b/test/python/conftest.py index 72a56dcf..0e0e808c 100644 --- a/test/python/conftest.py +++ b/test/python/conftest.py @@ -85,9 +85,8 @@ def temp_db_with_extensions(temp_db): def temp_db_conn(temp_db): """ Connection to the test database. """ - conn = connection.connect('dbname=' + temp_db) - yield conn - conn.close() + with connection.connect('dbname=' + temp_db) as conn: + yield conn @pytest.fixture