]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/api/test_api_polygons_v1.py
enable flake for Python tests
[nominatim.git] / test / python / api / test_api_polygons_v1.py
index 558be813e4d1b8c8183cd7ae5ae1826bb4d39149..e4700a95e6599160a06408aa6cd23bbaddb19681 100644 (file)
@@ -2,28 +2,19 @@
 #
 # This file is part of Nominatim. (https://nominatim.org)
 #
 #
 # 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
 import datetime as dt
 # For a full list of authors see the git log.
 """
 Tests for the deletable v1 API call.
 """
 import json
 import datetime as dt
-from pathlib import Path
 
 import pytest
 
 import pytest
-import pytest_asyncio
 
 
-from fake_adaptor import FakeAdaptor, FakeError, FakeResponse
+from fake_adaptor import FakeAdaptor
 
 import nominatim_api.v1.server_glue as glue
 
 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 TestPolygonsEndPoint:
 
 
 class TestPolygonsEndPoint:
@@ -44,13 +35,12 @@ class TestPolygonsEndPoint:
                                     errormessage text,
                                     prevgeometry geometry(Geometry,4326),
                                     newgeometry geometry(Geometry,4326)""",
                                     errormessage text,
                                     prevgeometry geometry(Geometry,4326),
                                     newgeometry geometry(Geometry,4326)""",
-                    content=[(345, 'N', 'boundary', 'administrative',
-                              {'name': 'Foo'}, 'xx', self.recent,
-                              'some text', None, None),
-                             (781, 'R', 'landuse', 'wood',
-                              None, 'ds', self.now,
-                              'Area reduced by lots', None, None)])
-
+                      content=[(345, 'N', 'boundary', 'administrative',
+                               {'name': 'Foo'}, 'xx', self.recent,
+                               'some text', None, None),
+                               (781, 'R', 'landuse', 'wood',
+                                None, 'ds', self.now,
+                                'Area reduced by lots', None, None)])
 
     @pytest.mark.asyncio
     async def test_polygons_simple(self, api):
 
     @pytest.mark.asyncio
     async def test_polygons_simple(self, api):
@@ -72,7 +62,6 @@ class TestPolygonsEndPoint:
                             'errormessage': 'Area reduced by lots',
                             'updated': self.now.isoformat(sep=' ', timespec='seconds')}]
 
                             'errormessage': 'Area reduced by lots',
                             'updated': self.now.isoformat(sep=' ', timespec='seconds')}]
 
-
     @pytest.mark.asyncio
     async def test_polygons_days(self, api):
         a = FakeAdaptor()
     @pytest.mark.asyncio
     async def test_polygons_days(self, api):
         a = FakeAdaptor()
@@ -83,7 +72,6 @@ class TestPolygonsEndPoint:
 
         assert [r['osm_id'] for r in results] == [781]
 
 
         assert [r['osm_id'] for r in results] == [781]
 
-
     @pytest.mark.asyncio
     async def test_polygons_class(self, api):
         a = FakeAdaptor()
     @pytest.mark.asyncio
     async def test_polygons_class(self, api):
         a = FakeAdaptor()
@@ -94,8 +82,6 @@ class TestPolygonsEndPoint:
 
         assert [r['osm_id'] for r in results] == [781]
 
 
         assert [r['osm_id'] for r in results] == [781]
 
-
-
     @pytest.mark.asyncio
     async def test_polygons_reduced(self, api):
         a = FakeAdaptor()
     @pytest.mark.asyncio
     async def test_polygons_reduced(self, api):
         a = FakeAdaptor()