refactor(tests): plugin tests to follow test conventions and fix regex warning#3244
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 updates and refactors plugin-related unit tests, simplifying test structure and modernizing mocking/fixtures while making a small regex-string fix in the Pip plugin.
Changes:
- Refactor conda parser tests from class-based to function-based tests and consolidate invalid-input cases via parametrization.
- Update Pip indices test mocking approach and remove
unittest.mockusage. - Refactor conda environment unit tests to use
tmp_pathand extract a thread worker helper; fix regex literal usage inpip.py.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| test/plugins/pip/test_pip_indices.py | Switches mocking approach for _call in a regression test. |
| test/plugins/conda/test_parsers.py | Refactors tests into standalone functions and parametrizes invalid cases. |
| test/plugins/conda/test_conda_environment_unit.py | Refactors concurrency/cleanup tests to use tmp_path and a helper worker function. |
| metaflow/plugins/pypi/pip.py | Uses a raw regex string for \w* to avoid invalid escape behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR refactors three plugin test files to follow pytest conventions (module-level functions instead of classes,
Confidence Score: 5/5All changes are confined to test files and a one-character fix in a production regex; no runtime behaviour is altered. The production change is a trivial raw-string prefix that removes a warning without touching logic. The test refactors are mechanically equivalent to the code they replace, use only fixtures already available in the declared dependencies, and the platform-sensitive fcntl import is properly guarded with pytest.importorskip. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "fix: scope fcntl skip in conda environme..." | Re-trigger Greptile |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3244 +/- ##
=========================================
Coverage ? 29.08%
=========================================
Files ? 381
Lines ? 52513
Branches ? 9266
=========================================
Hits ? 15275
Misses ? 36203
Partials ? 1035 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
PR Type
Summary