litellm/tests/test_litellm/proxy/client
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
..
cli test: enforce F811 so a duplicate definition cannot silently replace the first 2026-08-21 12:06:19 -07:00
test_chat.py build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
test_client.py test: rename tests that a later definition shadowed 2026-08-12 11:15:54 -07:00
test_credentials.py Change credential encryption to only affect db credentials 2025-12-09 13:36:40 -08:00
test_http_client.py fix delete callbacks 2025-11-06 17:06:34 -08:00
test_http_commands.py fix delete callbacks 2025-11-06 17:06:34 -08:00
test_keys.py fix(proxy/client): redact api key from key/info client error messages (#31342) 2026-06-25 17:35:15 -07:00
test_model_groups.py fix delete callbacks 2025-11-06 17:06:34 -08:00
test_models.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_users.py sys.path.insert for cli tests 2025-07-03 15:58:49 -07:00