Skip to content

Commit cd22b5c

Browse files
cliffhallclaude
andauthored
test(fetch): mark the tests that pin known bugs
These suites are characterization tests: they assert current behavior so the SDK v2 migration can show it changed nothing. Some of that behavior is wrong. Each test that pins a known bug now carries a one-line marker directly above it (above any decorators): # KNOWN BUG #<issue>: pins current (wrong) behavior; the fix changes this assertion. or, where no issue is filed: # KNOWN BUG (no issue): <what is wrong>; the fix changes this assertion. `git grep "KNOWN BUG"` lists exactly the bug-pinning tests. Tests that guard fixed behavior, check correct behavior, or pin a design a feature request wants changed (e.g. #4448's fixed timeouts) are left unmarked. Comments only; no assertion changes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: cliffhall <[email protected]>
1 parent 7d381c7 commit cd22b5c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎src/fetch/tests/test_protocol.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ async def test_initialize_advertises_tools_and_prompts(web: FakeWeb) -> None:
9292
assert "resources" not in data["capabilities"]
9393

9494

95+
# KNOWN BUG #360: pins current (wrong) behavior; the fix changes this assertion.
9596
async def test_server_version_is_the_sdk_version(web: FakeWeb) -> None:
9697
# Characterizes #360: serverInfo.version is the `mcp` SDK's version, not
9798
# this package's, because Server("mcp-fetch") is given no version.
@@ -106,6 +107,7 @@ async def test_server_version_is_the_sdk_version(web: FakeWeb) -> None:
106107
# --------------------------------------------------------------------------
107108

108109

110+
# KNOWN BUG #1624: pins current (wrong) behavior; the fix changes this assertion.
109111
async def test_list_tools_wire_shape(web: FakeWeb) -> None:
110112
async with connect() as (session, _):
111113
result = await session.list_tools()
@@ -216,6 +218,7 @@ async def test_invalid_url_is_rejected_by_pydantic(web: FakeWeb, url: str) -> No
216218
assert web.requests == []
217219

218220

221+
# KNOWN BUG (no issue): call_tool ignores the tool name and runs fetch for any name; the fix changes this assertion.
219222
async def test_call_tool_never_checks_the_tool_name(web: FakeWeb) -> None:
220223
# Characterizes call_tool ignoring `name`: an unknown tool name is not
221224
# rejected, the SDK skips schema validation for it (the tool is not
@@ -229,6 +232,7 @@ async def test_call_tool_never_checks_the_tool_name(web: FakeWeb) -> None:
229232
assert web.urls() == [ROBOTS, PAGE]
230233

231234

235+
# KNOWN BUG (no issue): call_tool ignores the tool name and runs fetch for any name; the fix changes this assertion.
232236
async def test_unknown_tool_name_still_validates_through_pydantic(
233237
web: FakeWeb,
234238
) -> None:
@@ -447,6 +451,7 @@ async def test_html_without_node_falls_back_to_pure_python(web: FakeWeb) -> None
447451
assert "https://example.com/x" not in text
448452

449453

454+
# KNOWN BUG (no issue): an empty page without Node reports "No more content available" at start_index 0 instead of a simplification failure; the fix changes this assertion.
450455
@pytest.mark.usefixtures("python_readability")
451456
async def test_empty_html_without_node_reads_as_no_more_content(web: FakeWeb) -> None:
452457
# The pure-Python extractor never returns empty content, so the
@@ -611,6 +616,7 @@ async def test_pagination_walks_the_whole_document(web: FakeWeb) -> None:
611616
# --------------------------------------------------------------------------
612617

613618

619+
# KNOWN BUG #4838: pins current (wrong) behavior; the fix changes this assertion.
614620
async def test_redirect_to_private_address_is_followed(web: FakeWeb) -> None:
615621
# Characterizes #4838: redirects are followed with no private-IP guard, so
616622
# a public URL can bounce the server to a link-local metadata address.
@@ -666,6 +672,7 @@ async def test_no_proxy_by_default(web: FakeWeb) -> None:
666672
assert web.client_kwargs == [{"proxy": None}]
667673

668674

675+
# KNOWN BUG #767, #1401: pins current (wrong) behavior; the fix changes this assertion.
669676
@pytest.mark.parametrize("ignore_robots_txt", [False, True])
670677
async def test_bad_proxy_config_surfaces_as_bare_text(ignore_robots_txt: bool) -> None:
671678
# Characterizes #767 and #1401: a bad proxy URL makes httpx.AsyncClient()
@@ -778,6 +785,7 @@ async def test_get_prompt_without_url_is_a_jsonrpc_error(
778785
assert web.requests == []
779786

780787

788+
# KNOWN BUG (no issue): get_prompt ignores the prompt name and serves fetch for any name; the fix changes this assertion.
781789
async def test_get_prompt_never_checks_the_prompt_name(web: FakeWeb) -> None:
782790
# Like call_tool, get_prompt ignores `name`.
783791
web.add(PAGE, plain("ok"))

0 commit comments

Comments
 (0)