mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
feat: support pytest trace back parsing
This commit is contained in:
parent
a007309f5d
commit
7442569c25
5 changed files with 163 additions and 28 deletions
|
|
@ -21,4 +21,24 @@ describe('pytest-junit tests', () => {
|
|||
expect(result.tests).toBe(1)
|
||||
expect(result.result).toBe('success')
|
||||
})
|
||||
|
||||
it('test failure with trace back', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'pytest', 'report-tb-short.xml')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
|
||||
const opts: ParseOptions = {
|
||||
parseErrors: true,
|
||||
trackedFiles: []
|
||||
}
|
||||
|
||||
const parser = new PytestJunitParser(opts)
|
||||
const result = await parser.parse(filePath, fileContent)
|
||||
expect(result.tests).toBe(1)
|
||||
expect(result.result).toBe('failed')
|
||||
expect(result.failedSuites[0].failedGroups[0].failedTests[0].error).toMatchObject({
|
||||
line: 6,
|
||||
message: 'assert False'
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue