Skip to content

Commit

Permalink
unescape HTML entities in test failure output (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nebopolis authored and wafflespeanut committed Jun 15, 2016
1 parent d4ca52f commit 614fc22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions handlers/homu_status/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re

from eventhandler import EventHandler
from HTMLParser import HTMLParser


def check_failure_log(api, bors_comment):
Expand Down Expand Up @@ -41,6 +42,8 @@ def check_failure_log(api, bors_comment):
stdio = api.get_page_content(failed_url)
failure_regex = r'.*Tests with unexpected results:\n(.*)\n</span><span'
failures = iter(re.findall(failure_regex, stdio, re.DOTALL)).next()
failures = HTMLParser().unescape(failures)

if failures:
comments = [' ' * 4 + line for line in failures.split('\n')]
api.post_comment('\n'.join(comments))
Expand Down

0 comments on commit 614fc22

Please sign in to comment.