Refactor pytest and unittest test discovery#25599
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the pytest and unittest test discovery implementations to improve code organization and reduce duplication. The changes extract common functionality into helper modules and consolidate process handling logic.
- Extracted environment configuration and command building logic into framework-specific helper modules
- Created shared discovery helper functions for process event handling and cancellation cleanup
- Restructured discovery adapter methods to use a more consistent pattern across both frameworks
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| src/client/testing/testController/unittest/unittestHelpers.ts | New helper module with environment setup and command building for unittest discovery |
| src/client/testing/testController/unittest/testDiscoveryAdapter.ts | Refactored discovery adapter to use extracted helpers and new shared process handlers |
| src/client/testing/testController/pytest/pytestHelpers.ts | New helper module with environment setup, symlink handling, and command building for pytest discovery |
| src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts | Refactored discovery adapter to use extracted helpers and new shared process handlers |
| src/client/testing/testController/common/discoveryHelpers.ts | New shared module providing process event handlers and cancellation cleanup logic for both frameworks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…r.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cleanup to assist with future changes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cleanup to assist with future changes