litellm/tests/test_litellm/proxy/client
ryan-crabbe-berri b76def0e5d
test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769)
`pytest.raises(Exception)` with no `match=` passes on any error that broad. A
TypeError from a refactor, a botched fixture, an import that moved: all of them
read as the rejection the test claims to police, so the test goes green for the
wrong reason and stays green after the behaviour it guards is gone.

PT011 closes that gap for the 317 sites B017 could not reach, because B017 only
fires on a single-statement body with no `as e` binding. Each pattern here is the
message the code actually raised, recorded by running the sites under a plugin
that logged the concrete type and text per call site, so the assertions describe
observed behaviour rather than a guess. Where a site raises more than one message
across its parametrize cases, the pattern is an alternation of what was seen;
where the exception carries an empty `str()` and puts the text on `.message`, the
site keeps a narrow `noqa` with the reason.

PT014 removes four parametrize cases that were listed twice. The duplicate re-runs
an assertion that already passed, and it usually marks a case someone meant to
vary and forgot to edit.
2026-08-20 20:24:49 -07:00
..
cli test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -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