Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Apr 18, 2023
1 parent fd1aff4 commit 7a49c4a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/client/testing/testController/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Uri,
WorkspaceFolder,
} from 'vscode';
// ** import { IPythonExecutionFactory } from '../../../common/process/types';
import { TestDiscoveryOptions } from '../../common/types';
import { IPythonExecutionFactory } from '../../../common/process/types';

Expand Down
5 changes: 2 additions & 3 deletions src/client/testing/testController/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
tool: 'pytest',
debugging: request.profile?.kind === TestRunProfileKind.Debug,
});
// ** new execution runner/adapter
// ** uncomment for NEW execution runner/adapter
// const testAdapter =
// this.testAdapters.get(workspace.uri) ||
// (this.testAdapters.values().next().value as WorkspaceTestAdapter);
Expand All @@ -415,12 +415,11 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
);
}
if (settings.testing.unittestEnabled) {
// potentially squeeze in the new execution way here?
sendTelemetryEvent(EventName.UNITTEST_RUN, undefined, {
tool: 'unittest',
debugging: request.profile?.kind === TestRunProfileKind.Debug,
});
// new execution runner/adapter
// uncomment for NEW execution runner/adapter
// const testAdapter =
// this.testAdapters.get(workspace.uri) ||
// (this.testAdapters.values().next().value as WorkspaceTestAdapter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export class PytestTestDiscoveryAdapter implements ITestDiscoveryAdapter {
}
}

// ** Old version of discover tests.
discoverTests(uri: Uri, executionFactory?: IPythonExecutionFactory): Promise<DiscoveredTestPayload> {
if (executionFactory !== undefined) {
// ** new version of discover tests.
const settings = this.configSettings.getSettings(uri);
const { pytestArgs } = settings.testing;
traceVerbose(pytestArgs);
return this.runPytestDiscovery(uri, executionFactory);
}
// if executionFactory is undefined, we are using the old version of discover tests.
// if executionFactory is undefined, we are using the old method signature of discover tests.
traceVerbose(uri);
this.deferred = createDeferred<DiscoveredTestPayload>();
return this.deferred.promise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
}
}

// ** Old version of discover tests.
async runTests(
uri: Uri,
testIds: string[],
Expand All @@ -48,10 +47,10 @@ export class PytestTestExecutionAdapter implements ITestExecutionAdapter {
): Promise<ExecutionTestPayload> {
traceVerbose(uri, testIds, debugBool);
if (executionFactory !== undefined) {
// ** new version of run tests.
return this.runTestsNew(uri, testIds, debugBool, executionFactory);
}
// TODO:Remove this line after enabling runs
// if executionFactory is undefined, we are using the old version of discover tests.
// if executionFactory is undefined, we are using the old method signature of run tests.
this.outputChannel.appendLine('Running tests.');
this.deferred = createDeferred<ExecutionTestPayload>();
return this.deferred.promise;
Expand Down

0 comments on commit 7a49c4a

Please sign in to comment.