Merge pull request #3960 from jayaddison/tests/has-pending-monkeypatch-robustness

Tests: parameter-agnostic 'Indexer.has_pending' monkeypatching
This commit is contained in:
Sarah Hoffmann
2026-02-05 21:05:57 +01:00
committed by GitHub

View File

@@ -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