]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/cursor.py
enable flake for Python tests
[nominatim.git] / test / python / cursor.py
index b3fc260a2526d016ae2607e681e702baaddb591e..5dc93cd57e3bd66cf1c5d516d2258e1dc7f2c780 100644 (file)
@@ -2,13 +2,14 @@
 #
 # This file is part of Nominatim. (https://nominatim.org)
 #
-# Copyright (C) 2024 by the Nominatim developer community.
+# Copyright (C) 2025 by the Nominatim developer community.
 # For a full list of authors see the git log.
 """
 Specialised psycopg cursor with shortcut functions useful for testing.
 """
 import psycopg
 
+
 class CursorForTesting(psycopg.Cursor):
     """ Extension to the DictCursor class that provides execution
         short-cuts that simplify writing assertions.
@@ -22,7 +23,6 @@ class CursorForTesting(psycopg.Cursor):
         assert self.rowcount == 1
         return self.fetchone()[0]
 
-
     def row_set(self, sql, params=None):
         """ Execute a query and return the result as a set of tuples.
             Fails when the SQL command returns duplicate rows.
@@ -34,7 +34,6 @@ class CursorForTesting(psycopg.Cursor):
 
         return result
 
-
     def table_exists(self, table):
         """ Check that a table with the given name exists in the database.
         """
@@ -42,7 +41,6 @@ class CursorForTesting(psycopg.Cursor):
                              WHERE tablename = %s""", (table, ))
         return num == 1
 
-
     def index_exists(self, table, index):
         """ Check that an indexwith the given name exists on the given table.
         """
@@ -51,7 +49,6 @@ class CursorForTesting(psycopg.Cursor):
                           (table, index))
         return num == 1
 
-
     def table_rows(self, table, where=None):
         """ Return the number of rows in the given table.
         """