test: add missing __init__.py files so duplicate tests basenames collect - #35609
Open
thejamesgore wants to merge 1 commit into
Open
Conversation
Contributor
Greptile SummaryAdds empty package markers to affected test-directory chains so pytest assigns fully qualified module names to duplicate-basename tests.
Confidence Score: 5/5The PR appears safe to merge and confines its effect to pytest module identity within the test tree. The empty package markers complete valid test-package chains, follow the repository’s existing convention, and resolve duplicate-basename collection without changing test assertions or production imports.
|
| Filename | Overview |
|---|---|
| tests/test_litellm/llms/init.py | Adds the package marker needed for qualified collection of tests beneath the LLM test hierarchy. |
| tests/test_litellm/llms/anthropic/experimental_pass_through/init.py | Completes the package chain for Anthropic experimental pass-through tests. |
| tests/test_litellm/llms/anthropic/experimental_pass_through/messages/init.py | Gives the messages test directory a qualified module namespace for collection. |
| tests/test_litellm/models/init.py | Prevents the models test basename from being imported as an unqualified top-level test module. |
| tests/test_litellm/proxy/client/init.py | Prevents the proxy-client test basename from colliding with the models test module. |
| tests/test_litellm/proxy/hooks/init.py | Completes the parent package chain for hook tests. |
| tests/test_litellm/proxy/hooks/litellm_skills/init.py | Gives LiteLLM skills tests a qualified module namespace. |
| tests/test_litellm/realtime_api/init.py | Packages realtime API tests so their test_main module does not collide during collection. |
| tests/test_litellm/responses/init.py | Packages response tests so duplicate streaming-iterator basenames remain distinct. |
Reviews (1): Last reviewed commit: "test: add missing __init__.py files so d..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
make test-unitaborts at collection on a fresh cloneHow it solves it:
__init__.pyto the nine directories with colliding testsRelevant issues
Fixes #35605
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
The bug is pytest collection itself so the collection output is the end to end behaviour and full repro is in #35605
On base 491eda3
make test-unitaborts at collection before running a single testWith 6398fbf collection succeeds and the suite actually runs. I have 4 test failures that also occur without this change due to a missing optional dependency and local CLI state issue #30175 fixes so the full suite passing belongs to CI
Measured with collection only the three errors are gone and the 58 tests they shadowed now collect here
The six previously colliding files also pass together in one session with 6398fbf
Type
✅ Test
Changes
I added empty
__init__.pyfiles to the nine directories along the package chains of the three colliding pairs, no test code changes were necessary, and this allows the remaining tests to actually run.I did consider switching pytest to
--import-mode=importlibbut that would change import semantics for test cases and that felt like a maintainer scale decision. Also considered renaming the files but this would go against the repos convention of test names mirroring the source tree. I also did find that there are multiple other instances of files with duplicated base names which could cause a problem in the future and can add those to this PR too or in a future one if it makes sense to.Final Attestation