]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/api/test_api_deletable_v1.py
enable flake for Python tests
[nominatim.git] / test / python / api / test_api_deletable_v1.py
index 1b8dc34d3b1b962f13c30f930531529e21bdd6d4..8ea4c9cd165949f6cca3146407254a5c93cc7978 100644 (file)
@@ -2,49 +2,36 @@
 #
 # 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.
 """
 Tests for the deletable v1 API call.
 """
 import json
-from pathlib import Path
 
 import pytest
-import pytest_asyncio
 
-import psycopg2.extras
-
-from fake_adaptor import FakeAdaptor, FakeError, FakeResponse
+from fake_adaptor import FakeAdaptor
 
 import nominatim_api.v1.server_glue as glue
-import nominatim_api as napi
-
-@pytest_asyncio.fixture
-async def api():
-    api = napi.NominatimAPIAsync(Path('/invalid'))
-    yield api
-    await api.close()
 
 
 class TestDeletableEndPoint:
 
     @pytest.fixture(autouse=True)
     def setup_deletable_table(self, temp_db_cursor, table_factory, temp_db_with_extensions):
-        psycopg2.extras.register_hstore(temp_db_cursor)
         table_factory('import_polygon_delete',
                       definition='osm_id bigint, osm_type char(1), class text, type text',
                       content=[(345, 'N', 'boundary', 'administrative'),
                                (781, 'R', 'landuse', 'wood'),
                                (781, 'R', 'landcover', 'grass')])
-        table_factory('placex',
-                      definition="""place_id bigint, osm_id bigint, osm_type char(1),
-                                    class text, type text, name HSTORE, country_code char(2)""",
-                      content=[(1, 345, 'N', 'boundary', 'administrative', {'old_name': 'Former'}, 'ab'),
-                               (2, 781, 'R', 'landuse', 'wood', {'name': 'Wood'}, 'cd'),
-                               (3, 781, 'R', 'landcover', 'grass', None, 'cd')])
-
-
+        table_factory(
+            'placex',
+            definition="""place_id bigint, osm_id bigint, osm_type char(1),
+                          class text, type text, name HSTORE, country_code char(2)""",
+            content=[(1, 345, 'N', 'boundary', 'administrative', {'old_name': 'Former'}, 'ab'),
+                     (2, 781, 'R', 'landuse', 'wood', {'name': 'Wood'}, 'cd'),
+                     (3, 781, 'R', 'landcover', 'grass', None, 'cd')])
 
     @pytest.mark.asyncio
     async def test_deletable(self, api):
@@ -64,4 +51,3 @@ class TestDeletableEndPoint:
                            {'place_id': 3, 'country_code': 'cd', 'name': None,
                             'osm_id': 781, 'osm_type': 'R',
                             'class': 'landcover', 'type': 'grass'}]
-