]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/conftest.py
also enable flake for tests in github actions
[nominatim.git] / test / python / conftest.py
index 3ced320558347685543e246dd90b5741c8716625..f95da39e4411fd68e8155ebef11643e0308bea4f 100644 (file)
@@ -2,7 +2,7 @@
 #
 # 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.
 import itertools
 import sys
@@ -69,6 +69,7 @@ def temp_db_with_extensions(temp_db):
 
     return temp_db
 
+
 @pytest.fixture
 def temp_db_conn(temp_db):
     """ Connection to the test database.
@@ -100,8 +101,9 @@ def table_factory(temp_db_conn):
             if content:
                 sql = pysql.SQL("INSERT INTO {} VALUES ({})")\
                            .format(pysql.Identifier(name),
-                                   pysql.SQL(',').join([pysql.Placeholder() for _ in range(len(content[0]))]))
-                cur.executemany(sql , content)
+                                   pysql.SQL(',').join([pysql.Placeholder()
+                                                        for _ in range(len(content[0]))]))
+                cur.executemany(sql, content)
 
     return mk_table
 
@@ -109,7 +111,7 @@ def table_factory(temp_db_conn):
 @pytest.fixture
 def def_config():
     cfg = Configuration(None)
-    cfg.set_libdirs(module='.', osm2pgsql='.')
+    cfg.set_libdirs(osm2pgsql=None)
     return cfg
 
 
@@ -118,7 +120,7 @@ def project_env(tmp_path):
     projdir = tmp_path / 'project'
     projdir.mkdir()
     cfg = Configuration(projdir)
-    cfg.set_libdirs(module='.', osm2pgsql='.')
+    cfg.set_libdirs(osm2pgsql=None)
     return cfg
 
 
@@ -178,6 +180,7 @@ def place_row(place_table, temp_db_cursor):
 
     return _insert
 
+
 @pytest.fixture
 def placex_table(temp_db_with_extensions, temp_db_conn):
     """ Create an empty version of the place table.
@@ -208,7 +211,7 @@ def osmline_table(temp_db_with_extensions, table_factory):
 def sql_preprocessor_cfg(tmp_path, table_factory, temp_db_with_extensions):
     table_factory('country_name', 'partition INT', ((0, ), (1, ), (2, )))
     cfg = Configuration(None)
-    cfg.set_libdirs(module='.', osm2pgsql='.', sql=tmp_path)
+    cfg.set_libdirs(osm2pgsql=None, sql=tmp_path)
     return cfg