litellm/tests/otel_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_e2e_budgeting.py fix(cli): mint per-session agent credential on lite login (#31072) 2026-06-26 09:05:15 -07:00
test_e2e_model_access.py test: require a match= on broad pytest.raises, and drop duplicate parametrize cases (#37769) 2026-08-20 20:24:49 -07:00
test_guardrails.py test: reject assertions on a caught error inside except (ruff PT017) 2026-08-21 13:35:08 -07:00
test_key_logging_callbacks.py [Fix] Proxy: Break managed-resources import cycle on Python 3.13 2026-05-04 20:05:24 -07:00
test_model_info.py [Feat] Allow setting supports_vision for Custom OpenAI endpoints + Added testing (#5821) 2024-09-21 11:35:55 -07:00
test_moderations.py test_basic_moderations_on_proxy_with_model 2025-10-27 13:49:47 -07:00
test_otel.py chore(ci): modernize model references in tests and configs (#27856) 2026-05-15 15:44:28 -07:00
test_prometheus.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_rerank.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_team_member_permissions.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_team_tag_routing.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00