File tree 2 files changed +12
-4
lines changed
src/client/testing/testController/common
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change
1
+ Support ` expectedFailure ` when running ` unittest ` tests using ` pytest ` .
Original file line number Diff line number Diff line change @@ -128,11 +128,18 @@ export async function updateResultFromJunitXml(
128
128
runInstance . failed ( node , message ) ;
129
129
runInstance . appendOutput ( fixLogLines ( text ) ) ;
130
130
} else if ( result . skipped ) {
131
- skipped += 1 ;
132
131
const skip = result . skipped [ 0 ] ;
133
- const text = `${ rawTestCaseNode . rawId } Skipped: [${ skip . $ . type } ]${ skip . $ . message } \r\n` ;
134
-
135
- runInstance . skipped ( node ) ;
132
+ let text = '' ;
133
+ if ( skip . $ . type === 'pytest.xfail' ) {
134
+ passed += 1 ;
135
+ // pytest.xfail ==> expected failure via @unittest.expectedFailure
136
+ text = `${ rawTestCaseNode . rawId } Passed: [${ skip . $ . type } ]${ skip . $ . message } \r\n` ;
137
+ runInstance . passed ( node ) ;
138
+ } else {
139
+ skipped += 1 ;
140
+ text = `${ rawTestCaseNode . rawId } Skipped: [${ skip . $ . type } ]${ skip . $ . message } \r\n` ;
141
+ runInstance . skipped ( node ) ;
142
+ }
136
143
runInstance . appendOutput ( fixLogLines ( text ) ) ;
137
144
} else {
138
145
passed += 1 ;
You can’t perform that action at this time.
0 commit comments