Tests: patch the address lookup where core now keeps it (postulo.plugins.public_addresses), before repinning past d9013ff7f #4

Open
opened 2026-09-29 21:41:19 +00:00 by tiagoagueda · 0 comments
Owner

postulo/postulo#248 (d9013ff7f on core's main) moved the address checks out of postulo.plugins.fetching into a new leaf module, postulo.plugins.public_addresses. The private _addresses_for moved with them and is deliberately not re-exported, because a patch on a re-export silently misses.

tests/test_apprise.py:62, in the compose_network fixture, does:

monkeypatch.setattr(fetching, "_addresses_for", addresses)

This is harmless while the core pin is 1d6cdd7e0, which still has the name. Once the pin moves past d9013ff7f, the fixture raises AttributeError at setup. The two tests that use it then error rather than silently pass: the one at line 170 (the container next door) and the one at line 183 (a name that resolves nowhere).

Fix, in the commit that moves the pin

Either:

  • The smallest fix: from postulo.plugins import public_addresses, registry in place of fetching, registry (line 9, where fetching is used nowhere else), and monkeypatch.setattr(public_addresses, "_addresses_for", addresses).
  • One that works at either pin and needs no private core name: patch socket.getaddrinfo instead, raising socket.gaierror for the names the test treats as unknown.

Found by an independent review of #248, which checked every postulo.* import and patch target in the plugin repositories. This is the only one affected.

postulo/postulo#248 (`d9013ff7f` on core's `main`) moved the address checks out of `postulo.plugins.fetching` into a new leaf module, `postulo.plugins.public_addresses`. The private `_addresses_for` moved with them and is deliberately not re-exported, because a patch on a re-export silently misses. `tests/test_apprise.py:62`, in the `compose_network` fixture, does: ```python monkeypatch.setattr(fetching, "_addresses_for", addresses) ``` This is harmless while the core pin is `1d6cdd7e0`, which still has the name. **Once the pin moves past `d9013ff7f`, the fixture raises `AttributeError` at setup.** The two tests that use it then error rather than silently pass: the one at line 170 (the container next door) and the one at line 183 (a name that resolves nowhere). ## Fix, in the commit that moves the pin Either: - **The smallest fix:** `from postulo.plugins import public_addresses, registry` in place of `fetching, registry` (line 9, where `fetching` is used nowhere else), and `monkeypatch.setattr(public_addresses, "_addresses_for", addresses)`. - **One that works at either pin and needs no private core name:** patch `socket.getaddrinfo` instead, raising `socket.gaierror` for the names the test treats as unknown. Found by an independent review of #248, which checked every `postulo.*` import and patch target in the plugin repositories. This is the only one affected.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Postulo/postulo-apprise#4
No description provided.