Skip to content

Commit 7b0c652

Browse files
ayhammoudaclaude
andcommitted
refactor(tests): collapse duplicate entry-point asserts to loop
Found via /simplify reuse + quality review of PR #22. Pure deduplication of the configparser-based entry-points assertions added in 78afc07 — the only thing varying between the two asserts was the CLI name lookup key. Saves 3 lines, single point of maintenance, no information loss on failure (the loop iteration variable appears in the assertion message). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent eba07b8 commit 7b0c652

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

tests/test_packaging.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ def test_wheel_has_entry_point(self, built_wheel):
9595
)
9696
scripts = dict(parser.items("console_scripts"))
9797
target = "mcp_server_python_docs.__main__:main"
98-
assert scripts.get(DIST_NAME) == target, (
99-
f"Expected {DIST_NAME} -> {target}, got {scripts!r}"
100-
)
101-
assert scripts.get(LEGACY_CLI_NAME) == target, (
102-
f"Expected {LEGACY_CLI_NAME} -> {target}, got {scripts!r}"
103-
)
98+
for cli_name in (DIST_NAME, LEGACY_CLI_NAME):
99+
assert scripts.get(cli_name) == target, (
100+
f"Expected {cli_name} -> {target}, got {scripts!r}"
101+
)
104102

105103

106104
class TestPyprojectDeps:

0 commit comments

Comments
 (0)