| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Adds project-based support for unittest execution/discovery by using the Python Environments “project” model, ensuring the correct interpreter is used per project and that debug sessions are launched with project context.
Changes:
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file| File | Description |
|---|---|
| src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts | Adds unit tests for project-aware unittest debug options and env-extension execution using the project environment. |
| src/client/testing/testController/unittest/testExecutionAdapter.ts | Passes project into debug launcher and uses project Python environment when useEnvExtension() is enabled. |
| src/client/testing/testController/unittest/testDiscoveryAdapter.ts | Uses project Python environment for env-extension-based unittest discovery. |
| src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts | Uses project Python environment for env-extension-based pytest discovery. |
| src/client/testing/testController/controller.ts | Switches to project-based execution whenever projects exist in the workspace. |
| src/client/testing/testController/common/testDiscoveryHandler.ts | Adds a unittest project-mode warning for likely nested-project import errors during discovery. |
| src/client/testing/common/debugLauncher.ts | Allows default debug cwd to come from the launch options (supports project-root defaulting). |
src/client/testing/testController/controller.ts:805
// Check if we're in project-based mode and should use project-specific execution
if (this.projectRegistry.hasProjects(workspace.uri)) {
const projects = this.projectRegistry.getProjectsArray(workspace.uri);
await executeTestsForProjects(projects, testItems, runInstance, request, token, {
projectRegistry: this.projectRegistry,
pythonExecFactory: this.pythonExecFactory,
debugLauncher: this.debugLauncher,
});
return;
}
src/client/testing/testController/unittest/testDiscoveryAdapter.ts:104
// Execute using environment extension if available
if (useEnvExtension()) {
traceInfo(`Using environment extension for unittest discovery in workspace ${uri.fsPath}`);
const pythonEnv = project?.pythonEnvironment ?? (await getEnvironment(uri));
if (!pythonEnv) {
traceError(
`Python environment not found for workspace ${uri.fsPath}. Cannot proceed with test discovery.`,
);
deferredTillExecClose.resolve();
return;
}
src/client/testing/testController/pytest/pytestDiscoveryAdapter.ts:119
// Execute using environment extension if available
if (useEnvExtension()) {
traceInfo(`Using environment extension for pytest discovery in workspace ${uri.fsPath}`);
const pythonEnv = project?.pythonEnvironment ?? (await getEnvironment(uri));
if (!pythonEnv) {
traceError(
`Python environment not found for workspace ${uri.fsPath}. Cannot proceed with test discovery.`,
);
deferredTillExecClose.resolve();
return;
}
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
No description provided.