refactor(tests): data/ tests to follow test conventions#3247
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR refactors and expands S3-related tests to improve readability, determinism, and coverage around long/Unicode path handling, while also tightening some test utilities/fixtures.
Changes:
- Refactored
generate_local_pathtests to usepytest.mark.parametrizewith explicit case IDs and added a short-URL non-truncation test. - Cleaned up
test_s3.pyfixtures and parameterizations (adds IDs, moves fixtures, tightens exception handling). - Simplified and clarified
reset_current_envteardown logic inconftest.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/data/s3/test_s3op.py | Reworks local-path tests into parametrized cases; adds indicator coverage for long vs short URLs; removes redundant try/finally wrapper. |
| test/data/s3/test_s3.py | Introduces/moves fixtures, replaces bare except, adds param IDs, and changes some S3 root usage in benchmark helpers. |
| test/data/s3/conftest.py | Refactors current reset fixture teardown to restore original private attributes and remove newly created ones. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| def _do(): | ||
| with S3(s3root=s3root) as s3: | ||
| with S3(s3root=S3ROOT) as s3: |
| def _do(): | ||
| new_files = [(str(uuid4()), path) for _, path in all_files] | ||
| with S3(s3root=s3root, inject_failure_rate=inject_failure_rate) as s3: | ||
| with S3(s3root=S3ROOT, inject_failure_rate=inject_failure_rate) as s3: |
Greptile SummaryThis PR refactors the
Confidence Score: 5/5Safe to merge — all changes are confined to the test suite, no production code is touched, and the two previously flagged issues are correctly resolved. Every change is a structural refactoring of test files: extracting constants, reorganising fixtures, and converting loop-based tests to parametrized form. The previously reported ids mismatch is fixed, and the put benchmark functions now correctly use the s3root fixture. No new logic is introduced in production code paths. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fixed conftest.py" | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3247 +/- ##
=========================================
Coverage ? 28.82%
=========================================
Files ? 381
Lines ? 52467
Branches ? 9260
=========================================
Hits ? 15126
Misses ? 36329
Partials ? 1012 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Type
Summary