@@ -62,6 +62,10 @@ export class TestResultDisplay {
6262 this . statusBar . text = statusText . length === 0 ? 'No Tests Ran' : statusText . join ( ' ' ) ;
6363 this . statusBar . color = foreColor ;
6464 this . statusBar . command = constants . Commands . Tests_View_UI ;
65+
66+ if ( statusText . length === 0 ) {
67+ vscode . window . showWarningMessage ( 'No tests ran, please check the configuration settings for the tests.' ) ;
68+ }
6569 return tests ;
6670 }
6771
@@ -105,33 +109,31 @@ export class TestResultDisplay {
105109 this . discoverCounter = 0 ;
106110 }
107111
108- public DisplayDiscoverStatus ( tests : Promise < Tests > , quietMode : boolean = false ) {
112+ public DisplayDiscoverStatus ( tests : Promise < Tests > ) {
109113 this . displayProgress ( 'Discovering Tests' , 'Discovering Tests (Click to Stop)' , constants . Commands . Tests_Ask_To_Stop_Discovery ) ;
110114 return tests . then ( tests => {
111- this . updateWithDiscoverSuccess ( tests , quietMode ) ;
115+ this . updateWithDiscoverSuccess ( tests ) ;
112116 return tests ;
113117 } ) . catch ( reason => {
114- this . updateWithDiscoverFailure ( reason , quietMode ) ;
118+ this . updateWithDiscoverFailure ( reason ) ;
115119 return Promise . reject ( reason ) ;
116120 } ) ;
117121 }
118122
119- private updateWithDiscoverSuccess ( tests : Tests , quietMode : boolean = false ) {
123+ private updateWithDiscoverSuccess ( tests : Tests ) {
120124 this . clearProgressTicker ( ) ;
121125 const haveTests = tests && ( tests . testFunctions . length > 0 ) ;
122126 this . statusBar . text = haveTests ? '$(zap) Run Tests' : 'No Tests' ;
123127 this . statusBar . tooltip = haveTests ? 'Run Tests' : 'No Tests discovered' ;
124128 this . statusBar . command = haveTests ? constants . Commands . Tests_View_UI : constants . Commands . Tests_Discover ;
125129 this . statusBar . show ( ) ;
126130
127- if ( ! haveTests && ! quietMode ) {
128- // TODO: show an option that will invoke a command 'python.test.configureTest' or similar
129- // This will be hanlded by main.ts that will capture input from user and configure the tests
130- vscode . window . showInformationMessage ( 'No Tests discovered' ) ;
131+ if ( ! haveTests ) {
132+ vscode . window . showInformationMessage ( 'No tests discovered, please check the configuration settings for the tests.' ) ;
131133 }
132134 }
133135
134- private updateWithDiscoverFailure ( reason : any , quietMode : boolean = false ) {
136+ private updateWithDiscoverFailure ( reason : any ) {
135137 this . clearProgressTicker ( ) ;
136138 this . statusBar . text = `$(zap) Discover Tests` ;
137139 this . statusBar . tooltip = 'Discover Tests' ;
@@ -142,10 +144,10 @@ export class TestResultDisplay {
142144 this . statusBar . text = `$(alert) Test discovery failed` ;
143145 this . statusBar . tooltip = `Discovering Tests failed (view 'Python Test Log' output panel for details)` ;
144146 // TODO: ignore this quitemode, always display the error message (inform the user)
145- if ( ! isNotInstalledError ( reason ) && ! quietMode ) {
147+ if ( ! isNotInstalledError ( reason ) ) {
146148 // TODO: show an option that will invoke a command 'python.test.configureTest' or similar
147149 // This will be hanlded by main.ts that will capture input from user and configure the tests
148- vscode . window . showErrorMessage ( 'There was an error in discovering tests' ) ;
150+ vscode . window . showErrorMessage ( 'There was an error in discovering tests, please check the configuration settings for the tests. ' ) ;
149151 }
150152 }
151153 }
0 commit comments