From 2a31df072b7599446662c3b76fcc864e21ccbd6e Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Tue, 29 Sep 2015 22:30:22 +0200 Subject: [PATCH] junitxml: reverse the if/else logic for failure appending --- _pytest/junitxml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_pytest/junitxml.py b/_pytest/junitxml.py index 59011651c..ca4f1c71d 100644 --- a/_pytest/junitxml.py +++ b/_pytest/junitxml.py @@ -262,10 +262,10 @@ class LogXML(object): self.append_pass(report) elif report.failed: self._opentestcase(report) - if report.when != "call": - self.append_error(report) - else: + if report.when == "call": self.append_failure(report) + else: + self.append_error(report) elif report.skipped: self._opentestcase(report) self.append_skipped(report)