From 75b4c7e56bfdf383913b9246ffc1bc97830f4567 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 26 May 2025 11:51:20 +0200 Subject: [PATCH] adapt to changed loop handling of pytest_asyncio --- test/python/api/conftest.py | 4 ++-- test/python/pytest.ini | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/python/api/conftest.py b/test/python/api/conftest.py index bde0afc4..944e66cb 100644 --- a/test/python/api/conftest.py +++ b/test/python/api/conftest.py @@ -192,7 +192,7 @@ def apiobj(temp_db_with_extensions, temp_db_conn, monkeypatch): @pytest.fixture(params=['postgres_db', 'sqlite_db']) -def frontend(request, event_loop, tmp_path): +def frontend(request, tmp_path): testapis = [] if request.param == 'sqlite_db': db = str(tmp_path / 'test_nominatim_python_unittest.sqlite') @@ -215,7 +215,7 @@ def frontend(request, event_loop, tmp_path): apiobj.async_to_sync(_do_sql()) - event_loop.run_until_complete(convert_sqlite.convert(None, db, options)) + apiobj.async_to_sync(convert_sqlite.convert(None, db, options)) outapi = napi.NominatimAPI(environ={'NOMINATIM_DATABASE_DSN': f"sqlite:dbname={db}", 'NOMINATIM_USE_US_TIGER_DATA': 'yes'}) testapis.append(outapi) diff --git a/test/python/pytest.ini b/test/python/pytest.ini index 15441de9..02fe3a86 100644 --- a/test/python/pytest.ini +++ b/test/python/pytest.ini @@ -1,3 +1,4 @@ [pytest] markers = - sanitizer_params \ No newline at end of file + sanitizer_params +asyncio_default_fixture_loop_scope = function -- 2.39.5