Skip to content

Commit 62d89d4

Browse files
committed
comments
1 parent e6b6cc2 commit 62d89d4

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

src/client/testing/testController/common/testDiscoveryHandler.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ export class TestDiscoveryHandler {
104104
errorText.includes('No module named');
105105

106106
if (isImportError) {
107-
traceWarn(
108-
`---
109-
[test-by-project] Import error during unittest discovery for project at ${workspacePath}. ` +
110-
`This may be caused by test files in nested project directories that require different dependencies. ` +
111-
`If these tests are discovered successfully by their own project (with the correct Python environment), ` +
112-
`this error can be safely ignored. To avoid this, consider excluding nested project paths from parent project discovery.
113-
---`,
114-
);
107+
const warningMessage =
108+
'--- ' +
109+
`[test-by-project] Import error during unittest discovery for project at ${workspacePath}. ` +
110+
'This may be caused by test files in nested project directories that require different dependencies. ' +
111+
'If these tests are discovered successfully by their own project (with the correct Python environment), ' +
112+
'this error can be safely ignored. To avoid this, consider excluding nested project paths from parent project discovery. ' +
113+
'---';
114+
traceWarn(warningMessage);
115115
}
116116
}
117117

src/test/testing/testController/unittest/testExecutionAdapter.unit.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,14 @@ suite('Unittest test execution adapter', () => {
534534
};
535535
runInBackgroundStub.resolves(mockProc2 as any);
536536

537+
// Create a promise that resolves when runInBackground is called
538+
const runInBackgroundCalled = new Promise<void>((resolve) => {
539+
runInBackgroundStub.callsFake(() => {
540+
resolve();
541+
return Promise.resolve(mockProc2 as any);
542+
});
543+
});
544+
537545
const testRun = typeMoq.Mock.ofType<TestRun>();
538546
testRun
539547
.setup((t) => t.token)
@@ -557,8 +565,8 @@ suite('Unittest test execution adapter', () => {
557565
mockProject,
558566
);
559567

560-
// Wait for the runInBackground to be called
561-
await new Promise((resolve) => setTimeout(resolve, 10));
568+
// Wait for runInBackground to be called
569+
await runInBackgroundCalled;
562570

563571
// Simulate process exit to complete the test
564572
exitCallbacks.forEach((cb) => cb(0, null));

0 commit comments

Comments
 (0)