Skip to content

Commit 902001d

Browse files
lesnik512claude
andcommitted
test(public-api): symmetric assertion against __all__
test_expected_exports used `missing = expected - set(__all__)` so it caught symbols missing from __all__ but not the reverse — symbols added to __all__ that aren't in the expected set slipped through (the companion test_all_exports_resolve catches symbols in __all__ that don't exist at all; the gap was real symbols accidentally added to __all__). Switch to `assert expected == set(__all__)` with a multi-line message that names both directions, so future test failures pinpoint which side drifted. Closes audit Nit finding (test_public_api.py:69-71) from planning/audit/2026-06-07-deep-audit.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1f45ba0 commit 902001d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/test_public_api.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,7 @@ def test_expected_exports() -> None:
6767
"before_request",
6868
"on_error",
6969
}
70-
missing = expected - set(httpware.__all__)
71-
assert not missing, f"expected exports missing from __all__: {missing}"
70+
actual = set(httpware.__all__)
71+
assert expected == actual, (
72+
f"__all__ mismatch:\n missing from __all__: {expected - actual}\n unexpected in __all__: {actual - expected}"
73+
)

0 commit comments

Comments
 (0)