litellm/tests/mcp_tests
yuneng-jiang 6a0d03914c
test: drop the cwd-relative sys.path.insert calls from the test suite (#37802)
* test: drop the cwd-relative sys.path.insert calls from the test suite

TQ003 stands at 1,077 across 1,058 files, and 1,015 of them are the same shape:
sys.path.insert(0, os.path.abspath("../..")) and its deeper siblings. The
argument resolves against the working directory rather than the file, so from
the repo root, where every job runs pytest, it inserts the directory two levels
above the checkout. It has never pointed at litellm. The package is installed
into the environment anyway, which is what actually makes the import work, and
what the rule's message has said all along.

Removing them leaves 1,634 imports of sys and os with no remaining reference,
and those go too, except where another test module imports the name back out of
the file. The rest of TQ003 is 62 call sites that resolve against __file__ or a
variable, which are a different question and are left alone.

Collection is identical either way: 45,871 tests and the same 51 pre-existing
collection errors before and after, and ruff reports no new undefined name.

* test: drop the duplicate imports the sys.path sweep exposed to F811

* test(pre-call-utils): restore the os import the new bedrock tests need
2026-08-22 09:25:58 -07:00
..
test_configs [Release Fix] (#22411) 2026-02-28 09:46:35 -08:00
conftest.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
mcp_e2e_upstream_server.py test(e2e): mcp suite for key-without-access denial (#33752) 2026-07-17 16:04:43 -07:00
mcp_server.py test: const 2026-01-19 12:03:26 +09:00
test_aresponses_api_with_mcp.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_mcp_auth_header_extraction.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_auth_priority.py feat(mcp): graft v2 resolver onto _create_mcp_client (none + api_key static family) (#31058) 2026-06-24 14:53:33 -07:00
test_mcp_chat_completions.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_client_unit.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_mcp_guardrails.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_mcp_hooks.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_mcp_litellm_client.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_mcp_logging.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_mcp_server.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_oauth2_mcp_config.yaml [UI] M2M OAuth2 UI Flow (#20794) 2026-02-09 19:28:02 -08:00
test_openapi_spec_path_url.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_per_user_oauth_cache.py [internal copy of #28008] Support MCP OAuth passthrough and issuer-scoped JWT auth (#28356) 2026-06-02 12:22:04 -07:00
test_proxy_mcp_e2e.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_semantic_tool_filter_e2e.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00