refactor: improve data sanity test assertions and duplicate reporting - #2819
Open
Tamil-Selvan12 wants to merge 1 commit into
Open
Tamil-Selvan12 wants to merge 1 commit into
Tamil-Selvan12 wants to merge 1 commit into
Conversation
|
Someone is attempting to deploy a commit to the DeepSource Team on Vercel. A member of the Team first needs to authorize it. |
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.
This PR addresses Issue #2273 by improving the data sanity tests in gfi/test_data.py.
Changes made:
Replaced bare assert statements with proper unittest assertions.
Removed unnecessary @staticmethod decorators from test methods.
Removed the unnecessary print() statement from the duplicate repository test.
Added clear error messages for missing data and labels files.
Improved duplicate repository reporting by showing the duplicated repository names when the test fails.
These changes improve the readability and maintainability of the test code and provide more useful information when a test fails, while preserving the existing test behavior.
Testing performed:
uv run python gfi/test_data.py — 5 tests passed.
uv run mypy gfi — no issues found.
git diff --check — passed.
AI assistance was used during development to understand the issue and improve the test code. The changes were reviewed and tested locally before submission.
Related issue: #2273