Skip to content

Commit ccf9072

Browse files
Change "Unit Test" to "Test" for commands. (microsoft#5107)
(for microsoft#5000)
1 parent bd9805a commit ccf9072

File tree

6 files changed

+39
-18
lines changed

6 files changed

+39
-18
lines changed

news/1 Enhancements/4384.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Change "Unit Test" phrasing to "Test" or "Testing".

package.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,18 @@
276276
"dark": "resources/dark/discovering-tests.svg"
277277
}
278278
},
279+
{
280+
"command": "python.stopTests",
281+
"title": "%python.command.python.stopTests.title%",
282+
"category": "Python",
283+
"icon": {
284+
"light": "resources/light/stop.svg",
285+
"dark": "resources/dark/stop.svg"
286+
}
287+
},
279288
{
280289
"command": "python.stopUnitTests",
281-
"title": "%python.command.python.stopUnitTests.title%",
290+
"title": "%python.command.python.stopTests.title% (deprecated)",
282291
"category": "Python",
283292
"icon": {
284293
"light": "resources/light/stop.svg",
@@ -573,7 +582,7 @@
573582
"when": "config.noExists"
574583
},
575584
{
576-
"command": "python.stopUnitTests",
585+
"command": "python.stopTests",
577586
"category": "Python",
578587
"when": "config.noExists"
579588
},
@@ -703,7 +712,7 @@
703712
"group": "navigation@1"
704713
},
705714
{
706-
"command": "python.stopUnitTests",
715+
"command": "python.stopTests",
707716
"when": "view == python_tests && busyTests",
708717
"group": "navigation@1"
709718
},

package.nls.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
"python.command.python.startREPL.title": "Start REPL",
44
"python.command.python.createTerminal.title": "Create Terminal",
55
"python.command.python.buildWorkspaceSymbols.title": "Build Workspace Symbols",
6-
"python.command.python.runtests.title": "Run All Unit Tests",
7-
"python.command.python.debugtests.title": "Debug All Unit Tests",
6+
"python.command.python.runtests.title": "Run All Tests",
7+
"python.command.python.debugtests.title": "Debug All Tests",
88
"python.command.python.execInTerminal.title": "Run Python File in Terminal",
99
"python.command.python.setInterpreter.title": "Select Interpreter",
1010
"python.command.python.updateSparkLibrary.title": "Update Workspace PySpark Libraries",
1111
"python.command.python.refactorExtractVariable.title": "Extract Variable",
1212
"python.command.python.refactorExtractMethod.title": "Extract Method",
1313
"python.command.python.viewOutput.title": "Show Output",
14-
"python.command.python.viewTestOutput.title": "Show Unit Test Output",
15-
"python.command.python.selectAndRunTestMethod.title": "Run Unit Test Method ...",
16-
"python.command.python.selectAndDebugTestMethod.title": "Debug Unit Test Method ...",
17-
"python.command.python.selectAndRunTestFile.title": "Run Unit Test File ...",
18-
"python.command.python.runCurrentTestFile.title": "Run Current Unit Test File",
19-
"python.command.python.runFailedTests.title": "Run Failed Unit Tests",
20-
"python.command.python.discoverTests.title": "Discover Unit Tests",
21-
"python.command.python.stopUnitTests.title": "Stop",
22-
"python.command.python.configureTests.title": "Configure Unit Tests",
14+
"python.command.python.viewTestOutput.title": "Show Test Output",
15+
"python.command.python.selectAndRunTestMethod.title": "Run Test Method ...",
16+
"python.command.python.selectAndDebugTestMethod.title": "Debug Test Method ...",
17+
"python.command.python.selectAndRunTestFile.title": "Run Test File ...",
18+
"python.command.python.runCurrentTestFile.title": "Run Current Test File",
19+
"python.command.python.runFailedTests.title": "Run Failed Tests",
20+
"python.command.python.discoverTests.title": "Discover Tests",
21+
"python.command.python.stopTests.title": "Stop",
22+
"python.command.python.configureTests.title": "Configure Tests",
2323
"python.command.python.execSelectionInTerminal.title": "Run Selection/Line in Python Terminal",
2424
"python.command.python.execSelectionInDjangoShell.title": "Run Selection/Line in Django Shell",
2525
"python.command.python.goToPythonObject.title": "Go to Python Object",

src/client/common/application/commands.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ interface ICommandNameWithoutArgumentTypeMapping {
5050
[DSCommands.ExpandAllCells]: [];
5151
[DSCommands.CollapseAllCells]: [];
5252
[DSCommands.ExportOutputAsNotebook]: [];
53+
// deprecated:
54+
['python.askToStopUnitTestDiscovery']: [];
55+
['python.askToStopUnitTests']: [];
5356
}
5457

5558
/**
@@ -103,4 +106,6 @@ export interface ICommandNameArgumentTypeMapping extends ICommandNameWithoutArgu
103106
[DSCommands.ImportNotebook]: [undefined | Uri, undefined | CommandSource];
104107
[DSCommands.ExportFileAsNotebook]: [undefined | Uri, undefined | CommandSource];
105108
[DSCommands.RunFileInInteractiveWindows]: [string];
109+
// deprecated:
110+
['python.stopUnitTests']: [undefined, Uri];
106111
}

src/client/common/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export namespace Commands {
2727
export const Sort_Imports = 'python.sortImports';
2828
export const Tests_Run = 'python.runtests';
2929
export const Tests_Debug = 'python.debugtests';
30-
export const Tests_Ask_To_Stop_Test = 'python.askToStopUnitTests';
31-
export const Tests_Ask_To_Stop_Discovery = 'python.askToStopUnitTestDiscovery';
32-
export const Tests_Stop = 'python.stopUnitTests';
30+
export const Tests_Ask_To_Stop_Test = 'python.askToStopTests';
31+
export const Tests_Ask_To_Stop_Discovery = 'python.askToStopTestDiscovery';
32+
export const Tests_Stop = 'python.stopTests';
3333
export const Test_Reveal_Test_Item = 'python.revealTestItem';
3434
export const ViewOutput = 'python.viewOutput';
3535
export const Tests_ViewOutput = 'python.viewTestOutput';

src/client/unittests/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,13 @@ export class UnitTestManagementService implements IUnitTestManagementService, Di
405405
commandManager.registerCommand(constants.Commands.Tests_Select_And_Debug_Method, (_, cmdSource: CommandSource = CommandSource.commandPalette, resource: Uri) => this.selectAndRunTestMethod(cmdSource, resource, true)),
406406
commandManager.registerCommand(constants.Commands.Tests_Select_And_Run_File, (_, cmdSource: CommandSource = CommandSource.commandPalette) => this.selectAndRunTestFile(cmdSource)),
407407
commandManager.registerCommand(constants.Commands.Tests_Run_Current_File, (_, cmdSource: CommandSource = CommandSource.commandPalette) => this.runCurrentTestFile(cmdSource)),
408-
commandManager.registerCommand(constants.Commands.Tests_Discovering, noop)
408+
commandManager.registerCommand(constants.Commands.Tests_Discovering, noop),
409+
410+
// We register the following commands for backward-compatibility
411+
// (where users may have set up key bindings, etc.).
412+
commandManager.registerCommand('python.stopUnitTests', (_, resource: Uri) => this.stopTests(resource)),
413+
commandManager.registerCommand('python.askToStopUnitTestDiscovery', () => this.displayStopUI('Stop discovering tests')),
414+
commandManager.registerCommand('python.askToStopUnitTests', () => this.displayStopUI('Stop running tests'))
409415
];
410416

411417
disposablesRegistry.push(...disposables);

0 commit comments

Comments
 (0)