Skip to content

Commit

Permalink
Fix an issue in pytest 3.0 that was preventing xpasses from being rep…
Browse files Browse the repository at this point in the history
…orted correctly
  • Loading branch information
davehunt committed Sep 23, 2016
1 parent 2415dcd commit 19b909b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Release Notes

* Fix corrupt image asset files
* Remove image links from self-contained report
* Fix issue with unexpected passes not being reported in pytest 3.0

**1.10.0 (2016-08-09)**

Expand Down
9 changes: 7 additions & 2 deletions pytest_html/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,17 @@ def _appendrow(self, outcome, report):

def append_passed(self, report):
if report.when == 'call':
self.passed += 1
self._appendrow('Passed', report)
if hasattr(report, "wasxfail"):
self.xpassed += 1
self._appendrow('XPassed', report)
else:
self.passed += 1
self._appendrow('Passed', report)

def append_failed(self, report):
if report.when == "call":
if hasattr(report, "wasxfail"):
# pytest < 3.0 marked xpasses as failures
self.xpassed += 1
self._appendrow('XPassed', report)
else:
Expand Down

0 comments on commit 19b909b

Please sign in to comment.