Skip to content

Commit dbb599c

Browse files
committed
ability to configure debug port for unittests
1 parent 89a6801 commit dbb599c

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,11 @@
803803
"default": true,
804804
"description": "Where to prompt to configure a test framework if potential tests directories are discovered."
805805
},
806+
"python.unitTest.debugPort": {
807+
"type": "number",
808+
"default": 3000,
809+
"description": "Port number used for debugging of unittests."
810+
},
806811
"python.unitTest.nosetestsEnabled": {
807812
"type": "boolean",
808813
"default": false,

src/client/common/configSettings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface ISortImportSettings {
2424

2525
export interface IUnitTestSettings {
2626
promptToConfigure: boolean;
27+
debugPort: number;
2728
nosetestsEnabled: boolean;
2829
nosetestPath: string;
2930
nosetestArgs: string[];
@@ -214,6 +215,7 @@ export class PythonSettings extends EventEmitter implements IPythonSettings {
214215
// Support for travis
215216
this.unitTest = this.unitTest ? this.unitTest : {
216217
promptToConfigure: true,
218+
debugPort: 3000,
217219
nosetestArgs: [], nosetestPath: 'nosetest', nosetestsEnabled: false,
218220
outputWindow: 'python',
219221
pyTestArgs: [], pyTestEnabled: false, pyTestPath: 'pytest',

src/client/unittests/unittest/runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export function runTest(testManager: BaseTestManager, rootDirectory: string, tes
131131
"request": "attach",
132132
"localRoot": rootDirectory,
133133
"remoteRoot": rootDirectory,
134-
"port": 3000,
134+
"port": settings.unitTest.debugPort,
135135
"secret": "my_secret",
136136
"host": "localhost"
137137
});

0 commit comments

Comments
 (0)