Skip to content

Commit e220045

Browse files
committed
fix formatting
1 parent 9a0c198 commit e220045

File tree

5 files changed

+76
-86
lines changed

5 files changed

+76
-86
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { Deferred, createDeferred } from '../../../common/utils/async';
1919
import { createReaderPipe, generateRandomPipeName } from '../../../common/pipes/namedPipes';
2020
import { EXTENSION_ROOT_DIR } from '../../../constants';
2121

22-
2322
export function fixLogLinesNoTrailing(content: string): string {
2423
const lines = content.split(/\r?\n/g);
2524
return `${lines.join('\r\n')}`;
@@ -35,7 +34,6 @@ export function createTestingDeferred(): Deferred<void> {
3534
return createDeferred<void>();
3635
}
3736

38-
3937
interface ExecutionResultMessage extends Message {
4038
params: ExecutionTestPayload;
4139
}

src/client/testing/testController/controller.ts

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -465,30 +465,22 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
465465
);
466466
}
467467
if (settings.testing.unittestEnabled) {
468-
sendTelemetryEvent(
469-
EventName.UNITTEST_RUN,
470-
undefined,
471-
{
472-
tool: 'unittest',
473-
debugging:
474-
request.profile?.kind ===
475-
TestRunProfileKind.Debug,
476-
},
477-
);
478-
// ** experiment to roll out NEW test discovery mechanism
479-
return testAdapter.executeTests(
480-
this.testController,
481-
runInstance,
482-
testItems,
483-
token,
484-
request.profile?.kind,
485-
this.pythonExecFactory,
486-
this.debugLauncher,
487-
await this.interpreterService.getActiveInterpreter(
488-
workspace.uri,
489-
),
490-
);
491-
}
468+
sendTelemetryEvent(EventName.UNITTEST_RUN, undefined, {
469+
tool: 'unittest',
470+
debugging: request.profile?.kind === TestRunProfileKind.Debug,
471+
});
472+
// ** experiment to roll out NEW test discovery mechanism
473+
return testAdapter.executeTests(
474+
this.testController,
475+
runInstance,
476+
testItems,
477+
token,
478+
request.profile?.kind,
479+
this.pythonExecFactory,
480+
this.debugLauncher,
481+
await this.interpreterService.getActiveInterpreter(workspace.uri),
482+
);
483+
}
492484
}
493485
if (!settings.testing.pytestEnabled && !settings.testing.unittestEnabled) {
494486
unconfiguredWorkspaces.push(workspace);

src/client/testing/testController/pytest/runner.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import { ITestsRunner } from '../common/types';
44

55
export class PytestRunner implements ITestsRunner {
6-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
7-
constructor() {
8-
// not used, but required for DI
9-
}
10-
}
6+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
7+
constructor() {
8+
// not used, but required for DI
9+
}
10+
}

src/client/testing/testController/unittest/runner.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import { ITestsRunner } from '../common/types';
55

66
export class UnittestRunner implements ITestsRunner {
7-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
8-
constructor() {
9-
// not used, but required for DI
10-
}
11-
}
7+
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
8+
constructor() {
9+
// not used, but required for DI
10+
}
11+
}

src/client/testing/testController/unittest/unittestController.ts

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -23,56 +23,56 @@ export class UnittestController implements ITestFrameworkController {
2323
item: TestItem,
2424
token?: CancellationToken,
2525
): Promise<void> {
26-
const workspace = this.workspaceService.getWorkspaceFolder(item.uri);
27-
if (workspace) {
28-
// if we are still discovering then wait
29-
const discovery = this.discovering.get(workspace.uri.fsPath);
30-
if (discovery) {
31-
await discovery.promise;
32-
}
26+
const workspace = this.workspaceService.getWorkspaceFolder(item.uri);
27+
if (workspace) {
28+
// if we are still discovering then wait
29+
const discovery = this.discovering.get(workspace.uri.fsPath);
30+
if (discovery) {
31+
await discovery.promise;
32+
}
3333

34-
// see if we have raw test data
35-
const rawTestData = this.testData.get(workspace.uri.fsPath);
36-
if (rawTestData) {
37-
if (rawTestData.root === item.id) {
38-
if (rawTestData.tests.length === 0) {
39-
testController.items.delete(item.id);
40-
return Promise.resolve();
41-
}
34+
// see if we have raw test data
35+
const rawTestData = this.testData.get(workspace.uri.fsPath);
36+
if (rawTestData) {
37+
if (rawTestData.root === item.id) {
38+
if (rawTestData.tests.length === 0) {
39+
testController.items.delete(item.id);
40+
return Promise.resolve();
41+
}
4242

43-
if (rawTestData.tests.length > 0) {
44-
await updateTestItemFromRawData(
45-
item,
46-
testController,
47-
this.idToRawData,
48-
item.id,
49-
[rawTestData],
50-
token,
51-
);
52-
} else {
53-
this.idToRawData.delete(item.id);
54-
testController.items.delete(item.id);
55-
}
56-
} else {
57-
const workspaceNode = getWorkspaceNode(item, this.idToRawData);
58-
if (workspaceNode) {
59-
await updateTestItemFromRawData(
60-
item,
61-
testController,
62-
this.idToRawData,
63-
workspaceNode.id,
64-
[rawTestData],
65-
token,
66-
);
67-
}
68-
}
69-
} else {
70-
const workspaceNode = getWorkspaceNode(item, this.idToRawData);
71-
if (workspaceNode) {
72-
testController.items.delete(workspaceNode.id);
73-
}
74-
}
75-
}
76-
return Promise.resolve();
77-
}
43+
if (rawTestData.tests.length > 0) {
44+
await updateTestItemFromRawData(
45+
item,
46+
testController,
47+
this.idToRawData,
48+
item.id,
49+
[rawTestData],
50+
token,
51+
);
52+
} else {
53+
this.idToRawData.delete(item.id);
54+
testController.items.delete(item.id);
55+
}
56+
} else {
57+
const workspaceNode = getWorkspaceNode(item, this.idToRawData);
58+
if (workspaceNode) {
59+
await updateTestItemFromRawData(
60+
item,
61+
testController,
62+
this.idToRawData,
63+
workspaceNode.id,
64+
[rawTestData],
65+
token,
66+
);
67+
}
68+
}
69+
} else {
70+
const workspaceNode = getWorkspaceNode(item, this.idToRawData);
71+
if (workspaceNode) {
72+
testController.items.delete(workspaceNode.id);
73+
}
74+
}
75+
}
76+
return Promise.resolve();
77+
}
7878
}

0 commit comments

Comments
 (0)