Refactor pytest and unittest test discovery#25599
Merged
eleanorjboyd merged 9 commits intomicrosoft:mainfrom Nov 29, 2025
Merged
Refactor pytest and unittest test discovery#25599eleanorjboyd merged 9 commits intomicrosoft:mainfrom
eleanorjboyd merged 9 commits intomicrosoft:mainfrom
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.
src/client/testing/testController/unittest/testDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/unittest/testDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/unittest/testDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
…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.
src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/unittest/testDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
src/client/testing/testController/unittest/testDiscoveryAdapter.ts
Outdated
Show resolved
Hide resolved
roblourens
approved these changes
Nov 21, 2025
eleanorjboyd
added a commit
to eleanorjboyd/vscode-python
that referenced
this pull request
Dec 3, 2025
cleanup to assist with future changes --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
cleanup to assist with future changes