Skip to content

Fix #289: resolve 11 pre-existing test failures on main#304

Open
ericleepi314 wants to merge 1 commit into
mainfrom
fix/issue-289-test-failures
Open

Fix #289: resolve 11 pre-existing test failures on main#304
ericleepi314 wants to merge 1 commit into
mainfrom
fix/issue-289-test-failures

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Closes #289

Summary

Full pytest tests on main was red with 13 failures; 2 are tracked separately in #274. This fixes the other 11, each at its root cause:

Group Root cause Fix
providers (5 tests) Implementation intentionally wraps SDK clients with with_options(timeout=…, max_retries=…) (stalled-stream protection); test mocks predated it Mock with_options as pass-through + new TestApplyClientTimeout (3 tests) covering the wrap kwargs, env overrides, and the failure fallback
parity defaults (2 tests) TS-default check applied to ALL registered tools, but advisor/Workflow are Python-only and legitimately read-only/concurrency-safe Scope the default checks to TS core tools (from ts_tool_names.json)
MCP validation (2 tests) command="python" absent from PATH on python3-only systems Use sys.executable
web_fetch (1 test) Regex fallback _NOISE_BLOCK_RE missed iframe|object|embed which the bs4 path strips — real implementation bug, iframe content leaked into extracted text Add them to the alternation
bridge (1 test) Untracked stale src/services/bridge/__pycache__ in a checkout survives branch switches and imports as a namespace package Use find_spec; tolerate origin is None (namespace pkg), still fail if a real shim (__init__.py) returns

Also adds testpaths = ["tests"] per the issue's suggestion so bare pytest no longer aborts collection on reference_projects/.

Test plan

🤖 Generated with Claude Code

- providers: mocks predated the with_options timeout wrap; mock it as a
  pass-through and add dedicated _apply_client_timeout coverage
- parity: scope TS property defaults to TS core tools (advisor/Workflow
  are Python-only and legitimately read-only/concurrency-safe)
- mcp: validate with sys.executable, not bare "python" (absent on
  python3-only systems)
- web_fetch: regex fallback now strips iframe/object/embed like the bs4
  path does
- bridge: tolerate the stale __pycache__ namespace package that survives
  branch switches; still fails if the real shim returns
- pyproject: testpaths=["tests"] so bare pytest doesn't collect
  reference_projects/

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-existing test failures on main: 11 red tests across bridge/parity/mcp/providers/web_fetch

1 participant