Commit 4fd2852
committed
refactor: address PR #1398 KP13 second-pass review (3 items)
1. Narrow cleanup-loop exception in test_poll_cadence_measurement.py from
`except Exception` to `except _POLLING_TRANSIENT_ERRORS` (the canonical
tuple from wait_helpers.py). Programmer bugs (TypeError, AttributeError,
KeyError, AssertionError) now propagate with their stack trace instead
of being downgraded to a `logger.warning` line across 10 iterations.
Aligns per-entity cleanup with the polling-helper pattern established
for AGENTS.md "Exception handling in polling helpers" (#1266).
2. Lift the soft-failure warning prefix out of tools_config_automations.py
as module-level `NOT_VERIFIED_WARNING_PREFIX` and import it in the test.
The literal coupling becomes a compile-time edge instead of a runtime
puzzle — rewording the source warning now breaks the test import,
replacing the previous "9 samples + 0 not-verified != 10 attempts"
indirect signal with a clear ModuleNotFoundError-style failure.
3. Replace the stale `session-scoped` label in the cleanup-block comment
with `logging-only` (matches the commit-message framing for the
``cleanup_tracker`` fixture, which is function-scoped per its
`@pytest.fixture` decorator in tests/src/e2e/conftest.py:1951).1 parent f34ea9a commit 4fd2852
2 files changed
Lines changed: 22 additions & 15 deletions
File tree
- src/ha_mcp/tools
- tests/src/e2e/workflows/automation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
767 | 778 | | |
768 | 779 | | |
769 | 780 | | |
770 | | - | |
| 781 | + | |
771 | 782 | | |
772 | 783 | | |
773 | 784 | | |
| |||
Lines changed: 10 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 40 | | |
47 | 41 | | |
48 | 42 | | |
| |||
100 | 94 | | |
101 | 95 | | |
102 | 96 | | |
103 | | - | |
| 97 | + | |
104 | 98 | | |
105 | 99 | | |
106 | 100 | | |
| |||
194 | 188 | | |
195 | 189 | | |
196 | 190 | | |
197 | | - | |
| 191 | + | |
198 | 192 | | |
199 | 193 | | |
200 | | - | |
201 | | - | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
202 | 198 | | |
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
206 | 202 | | |
207 | 203 | | |
208 | 204 | | |
209 | | - | |
| 205 | + | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
0 commit comments