X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5e477e3b5b99da6fc4e54749d4671a6fc8fdcd66..e92e03e2e6b892e6dc7a931fe0e70de9315bd302:/test/python/cursor.py diff --git a/test/python/cursor.py b/test/python/cursor.py index 73b83b1d..b3fc260a 100644 --- a/test/python/cursor.py +++ b/test/python/cursor.py @@ -1,15 +1,15 @@ -# SPDX-License-Identifier: GPL-2.0-only +# SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of Nominatim. (https://nominatim.org) # -# Copyright (C) 2022 by the Nominatim developer community. +# Copyright (C) 2024 by the Nominatim developer community. # For a full list of authors see the git log. """ -Specialised psycopg2 cursor with shortcut functions useful for testing. +Specialised psycopg cursor with shortcut functions useful for testing. """ -import psycopg2.extras +import psycopg -class CursorForTesting(psycopg2.extras.DictCursor): +class CursorForTesting(psycopg.Cursor): """ Extension to the DictCursor class that provides execution short-cuts that simplify writing assertions. """ @@ -59,9 +59,3 @@ class CursorForTesting(psycopg2.extras.DictCursor): return self.scalar('SELECT count(*) FROM ' + table) return self.scalar('SELECT count(*) FROM {} WHERE {}'.format(table, where)) - - - def execute_values(self, *args, **kwargs): - """ Execute the execute_values() function on the cursor. - """ - psycopg2.extras.execute_values(self, *args, **kwargs)