@@ -119,14 +119,6 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
119
119
this . disposables . push ( delayTrigger ) ;
120
120
this . refreshData = delayTrigger ;
121
121
122
- const coverageProfile = this . testController . createRunProfile (
123
- 'Coverage Tests' ,
124
- TestRunProfileKind . Coverage ,
125
- this . runTests . bind ( this ) ,
126
- true ,
127
- RunTestTag ,
128
- ) ;
129
-
130
122
this . disposables . push (
131
123
this . testController . createRunProfile (
132
124
'Run Tests' ,
@@ -142,8 +134,19 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
142
134
true ,
143
135
DebugTestTag ,
144
136
) ,
145
- coverageProfile ,
146
137
) ;
138
+ if ( pythonTestAdapterRewriteEnabled ( this . serviceContainer ) ) {
139
+ // only add the coverage profile if the new test adapter is enabled
140
+ const coverageProfile = this . testController . createRunProfile (
141
+ 'Coverage Tests' ,
142
+ TestRunProfileKind . Coverage ,
143
+ this . runTests . bind ( this ) ,
144
+ true ,
145
+ RunTestTag ,
146
+ ) ;
147
+
148
+ this . disposables . push ( coverageProfile ) ;
149
+ }
147
150
this . testController . resolveHandler = this . resolveChildren . bind ( this ) ;
148
151
this . testController . refreshHandler = ( token : CancellationToken ) => {
149
152
this . disposables . push (
@@ -420,11 +423,11 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
420
423
421
424
const settings = this . configSettings . getSettings ( workspace . uri ) ;
422
425
if ( testItems . length > 0 ) {
423
- // coverage??
424
426
const testAdapter =
425
427
this . testAdapters . get ( workspace . uri ) ||
426
428
( this . testAdapters . values ( ) . next ( ) . value as WorkspaceTestAdapter ) ;
427
429
430
+ // no profile will have TestRunProfileKind.Coverage if rewrite isn't enabled
428
431
if ( request . profile ?. kind && request . profile ?. kind === TestRunProfileKind . Coverage ) {
429
432
request . profile . loadDetailedCoverage = (
430
433
_testRun : TestRun ,
0 commit comments