Skip to content

Commit 32f87e8

Browse files
dougborgclaude
andcommitted
test: remove dead stocktrim_client_with_mock_transport fixture
Addresses Copilot's review on #168: the fixture was already broken — \`AuthenticatedClient._client\` is initialized to \`None\` and isn't created until \`get_httpx_client()\` runs, so the original \`client._client._transport = mock_transport\` assignment raised \`AttributeError\`. My #168 \"fix\" replaced a mypy-style ignore with an \`assert client._client is not None\`, but the assert would always fire the moment anything actually used the fixture. It never did: \`grep -rn stocktrim_client_with_mock_transport\` finds zero callers anywhere in \`tests/\` or \`stocktrim_mcp_server/tests/\`. That's why CI stayed green through both the original broken version and my equally-broken \"fix\". Deleting it rather than rewriting it via \`set_httpx_client\` / \`set_async_httpx_client\`, since there's no consumer and we already have working transport-mocking patterns (\`httpx.MockTransport\` via \`mock_transport_handler\` / \`AsyncMockTransport\`) used by every actual test that needs network isolation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 130f4ee commit 32f87e8

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

tests/conftest.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,3 @@ def mock_not_found_response():
214214
response.headers = {"Content-Type": "application/problem+json"}
215215
response.text = '{"type": "...", "title": "Not Found", "status": 404}'
216216
return response
217-
218-
219-
@pytest.fixture
220-
def stocktrim_client_with_mock_transport(mock_api_credentials, mock_transport):
221-
"""Create a StockTrimClient with mock transport for testing without network calls."""
222-
client = StockTrimClient(**mock_api_credentials)
223-
# Replace the transport with mock
224-
assert client._client is not None
225-
client._client._transport = mock_transport
226-
return client

0 commit comments

Comments
 (0)