]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/python/api/test_api_search.py
enable flake for Python tests
[nominatim.git] / test / python / api / test_api_search.py
index 22dbaa2642d63a99ad227246c2c135139c087bcc..59a83aa99b69f362ee2ab8681ef89ea8d10db3dc 100644 (file)
@@ -2,7 +2,7 @@
 #
 # This file is part of Nominatim. (https://nominatim.org)
 #
 #
 # This file is part of Nominatim. (https://nominatim.org)
 #
-# Copyright (C) 2023 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 search API calls.
 # For a full list of authors see the git log.
 """
 Tests for search API calls.
@@ -10,26 +10,23 @@ Tests for search API calls.
 These tests make sure that all Python code is correct and executable.
 Functional tests can be found in the BDD test suite.
 """
 These tests make sure that all Python code is correct and executable.
 Functional tests can be found in the BDD test suite.
 """
-import json
-
 import pytest
 
 import pytest
 
-import sqlalchemy as sa
-
-import nominatim.api as napi
-import nominatim.api.logging as loglib
+import nominatim_api.logging as loglib
 
 API_OPTIONS = {'search'}
 
 
 API_OPTIONS = {'search'}
 
+
 @pytest.fixture(autouse=True)
 def setup_icu_tokenizer(apiobj):
 @pytest.fixture(autouse=True)
 def setup_icu_tokenizer(apiobj):
-    """ Setup the propoerties needed for using the ICU tokenizer.
+    """ Setup the properties needed for using the ICU tokenizer.
     """
     apiobj.add_data('properties',
                     [{'property': 'tokenizer', 'value': 'icu'},
                      {'property': 'tokenizer_import_normalisation', 'value': ':: lower();'},
     """
     apiobj.add_data('properties',
                     [{'property': 'tokenizer', 'value': 'icu'},
                      {'property': 'tokenizer_import_normalisation', 'value': ':: lower();'},
-                     {'property': 'tokenizer_import_transliteration', 'value': "'1' > '/1/'; 'ä' > 'ä '"},
-                    ])
+                     {'property': 'tokenizer_import_transliteration',
+                      'value': "'1' > '/1/'; 'ä' > 'ä '"},
+                     ])
 
 
 def test_search_no_content(apiobj, frontend):
 
 
 def test_search_no_content(apiobj, frontend):
@@ -64,7 +61,7 @@ def test_search_with_debug(apiobj, frontend, logtype):
 
     api = frontend(apiobj, options=API_OPTIONS)
     loglib.set_log_output(logtype)
 
     api = frontend(apiobj, options=API_OPTIONS)
     loglib.set_log_output(logtype)
-    results = api.search('TEST')
+    api.search('TEST')
 
     assert loglib.get_and_disable()
 
 
     assert loglib.get_and_disable()