From 3db7c6d804dc8f42a0280b8971115ae8975f8937 Mon Sep 17 00:00:00 2001 From: James Addison Date: Mon, 2 Feb 2026 11:35:10 +0000 Subject: [PATCH] Tests: parameter-agnostic `has_pending` monkeypatching Instead of relying on runtime parameter compatibility between the patched `has_pending` method and `list.pop`, use a proxy lambda function that accepts arbitrary keyword params. --- test/python/cli/test_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/python/cli/test_cli.py b/test/python/cli/test_cli.py index a538049e..2b0d4b84 100644 --- a/test/python/cli/test_cli.py +++ b/test/python/cli/test_cli.py @@ -91,8 +91,9 @@ class TestCliWithDb: postcode_mock = async_mock_func_factory(nominatim_db.indexer.indexer.Indexer, 'index_postcodes') + has_pending_retvals = [True, False] monkeypatch.setattr(nominatim_db.indexer.indexer.Indexer, 'has_pending', - [False, True].pop) + lambda *args, **kwargs: has_pending_retvals.pop(0)) assert self.call_nominatim('index', *params) == 0