@@ -77,7 +77,7 @@ suite('Unit Tests - Debug Launcher', () => {
7777 settings = TypeMoq . Mock . ofType < IPythonSettings > ( undefined , TypeMoq . MockBehavior . Strict ) ;
7878 configService . setup ( ( c ) => c . getSettings ( TypeMoq . It . isAny ( ) ) ) . returns ( ( ) => settings . object ) ;
7979
80- unitTestSettings = TypeMoq . Mock . ofType < ITestingSettings > ( undefined , TypeMoq . MockBehavior . Strict ) ;
80+ unitTestSettings = TypeMoq . Mock . ofType < ITestingSettings > ( ) ;
8181 settings . setup ( ( p ) => p . testing ) . returns ( ( ) => unitTestSettings . object ) ;
8282
8383 debugEnvHelper = TypeMoq . Mock . ofType < IDebugEnvironmentVariablesService > ( undefined , TypeMoq . MockBehavior . Strict ) ;
@@ -333,6 +333,21 @@ suite('Unit Tests - Debug Launcher', () => {
333333 debugService . verifyAll ( ) ;
334334 } ) ;
335335
336+ test ( 'Use cwd value in settings if exist' , async ( ) => {
337+ unitTestSettings . setup ( ( p ) => p . cwd ) . returns ( ( ) => 'path/to/settings/cwd' ) ;
338+ const options : LaunchOptions = {
339+ cwd : 'one/two/three' ,
340+ args : [ '/one/two/three/testfile.py' ] ,
341+ testProvider : 'unittest' ,
342+ } ;
343+ const expected = getDefaultDebugConfig ( ) ;
344+ expected . cwd = 'path/to/settings/cwd' ;
345+ setupSuccess ( options , 'unittest' , expected ) ;
346+ await debugLauncher . launchDebugger ( options ) ;
347+
348+ debugService . verifyAll ( ) ;
349+ } ) ;
350+
336351 test ( 'Full debug config' , async ( ) => {
337352 const options : LaunchOptions = {
338353 cwd : 'one/two/three' ,
0 commit comments