Commit graph

15 commits

Author SHA1 Message Date
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
ryan-crabbe-berri
e9d40a8f73 test: enforce F811 so a duplicate definition cannot silently replace the first
A name bound twice keeps only the second binding. In `tests/` that is nearly
always a repeated import, harmless but misleading, and the same rule is what
catches the cases that are not harmless: a local that shadows an import the
module still calls, and a second `def test_x` that quietly replaces the first.

311 of the 344 sites were repeated imports and came out with ruff's own fix.
The remaining 33 needed a decision. Four modules imported a name they never
used because a local definition below already shadowed it. Two comprehensions
bound `call` over `unittest.mock.call`, which those modules import and use.
One test rebound the two module handles its nested reload closure had captured.
One class attribute shadowed an unused `status` import.

The load-test fixtures move to a conftest, which is how pytest is meant to share
them, so the test module no longer imports three fixture names it never calls.
The nine `prisma_client` parameters keep a narrow `noqa`: pytest resolves that
fixture by name before the body runs, so the parameter never shadows anything.
2026-08-21 12:06:19 -07:00
Ishaan Jaffer
e8461b5b97
style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
Jugal D. Bhatt
5db4862cbf
[MCP Gateway] Litellm mcp client list fail (#13114)
* fix headers

* fix test

* fix ruff

* added try except for catching errors which lead to client failures

* fix mypy

* fix ruff

* fix tests

* fix python error

* fix test

* fix test

* fixed the MCP Call Tool result
2025-07-30 15:23:19 -07:00
Jugal D. Bhatt
eb8a338d9b
[MCP Guardrails] move pre and during hooks to ProxyLoggin (#13109)
* move pre and during hooks t o ProxyLoggin

* fix lint

* fix ruff

* fix tests
2025-07-30 13:58:41 -07:00
Ishaan Jaff
8a71f129bf ci_cd_server_path 2025-03-21 19:06:29 -07:00
Ishaan Jaff
19d6051dba test mcp agent 2025-03-21 17:48:16 -07:00
Ishaan Jaff
6fb2ae8731 docs mcp docs update 2025-03-21 17:21:40 -07:00
Ishaan Jaff
b8b7e5e6cf clean up 2025-03-21 14:39:05 -07:00
Ishaan Jaff
147787b9e0 call_openai_tool on MCP client 2025-03-21 14:36:32 -07:00
Ishaan Jaff
bbf1962540 fix llm responses 2025-03-21 10:50:55 -07:00
Ishaan Jaff
1a56bb5bdd transform_mcp_tool_to_openai_tool 2025-03-21 10:49:06 -07:00
Ishaan Jaff
d3279d114e litellm MCP client 1 2025-03-21 10:32:51 -07:00
Ishaan Jaff
d61febc053 change location of MCP client 2025-03-21 10:30:57 -07:00
Ishaan Jaff
177e72334c simple MCP interface 2025-03-21 10:11:06 -07:00