Maksym Shalamov | 6f5e8d9 | 2018-04-12 18:19:09 +0300 | [diff] [blame] | 1 | --- junitxml/__init__.py 2018-04-12 15:13:39.394382000 +0300 |
| 2 | +++ junitxml/__init__.py 2018-04-12 16:58:12.288281319 +0300 |
| 3 | @@ -165,10 +165,16 @@ |
| 4 | run. |
| 5 | """ |
| 6 | duration = self._duration(self._run_start) |
| 7 | - self._stream.write('<testsuite errors="%d" failures="%d" name="" ' |
| 8 | - 'tests="%d" time="%0.3f">\n' % (len(self.errors), |
| 9 | + |
| 10 | + if len(self.skipped) == 0: |
| 11 | + skipped = "" |
| 12 | + else: |
| 13 | + skipped = 'skipped="{}" '.format(len(self.skipped)) |
| 14 | + |
| 15 | + self._stream.write('<testsuite errors="%d" failures="%d"' |
| 16 | + ' skipped="%d" name="" tests="%d" time="%0.3f">\n' % (len(self.errors), |
| 17 | len(self.failures) + len(getattr(self, "unexpectedSuccesses", ())), |
| 18 | - self.testsRun, duration)) |
| 19 | + len(self.skipped), self.testsRun, duration)) |
| 20 | self._stream.write(''.join(self._results)) |
| 21 | self._stream.write('</testsuite>\n') |
| 22 | |