junitparser icon indicating copy to clipboard operation
junitparser copied to clipboard

Verification fails if root element is <testsuite> and <system-out> presents

Open Hsilgos opened this issue 1 year ago • 0 comments

If root element is <testsuite> (not <testsuites>) and there is <system-out> (I think any other also will trigger the issue) then junitparser verify ... fails with

Traceback (most recent call last):
  File "/Users/.../Library/Python/3.9/bin/junitparser", line 8, in <module>
    sys.exit(main())
  File "/Users/.../Library/Python/3.9/lib/python/site-packages/junitparser/cli.py", line 100, in main
    return verify(
  File "/Users/.../Library/Python/3.9/lib/python/site-packages/junitparser/cli.py", line 33, in verify
    if not case.is_passed and not case.is_skipped:
AttributeError: 'SystemOut' object has no attribute 'is_passed'

Basically this is junit test report from cucumber test runner. Simplest example to reproduce the issue:

<?xml version="1.0" encoding="UTF-8"?><testsuite tests="783" name="cucumber.runtime.formatter.JUnitFormatter" failures="0" skipped="0" time="1272.267746">
<testcase classname="Test functionality" name="Test name" time="0.641439">
<system-out><![CDATA[Some test.......................passed
]]></system-out>
</testcase>
</testsuite>

Hsilgos avatar Jul 26 '23 15:07 Hsilgos