Skip to content

Commit

Permalink
Fix handling of failure reasons in FailedTests
Browse files Browse the repository at this point in the history
  • Loading branch information
brechtm committed Oct 7, 2015
1 parent da49564 commit 935508f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/citeproc-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ def __init__(self, filename):
self.filename = filename
with open(filename, 'r') as file:
self.lines = file.readlines()
self.now_failing = []
self.now_failing = {}

def mark_failure(self, test_name, reason=None):
self.now_failing.append((test_name, reason))
self.now_failing[test_name] = reason

def update_file(self):
was_failing = set()
Expand All @@ -184,8 +184,9 @@ def update_file(self):
continue
was_failing.add(test_name)
file.write(line)
for test_name, reason in sorted(self.now_failing):
for test_name in sorted(self.now_failing.keys()):
if test_name not in was_failing:
reason = self.now_failing[test_name]
line = ('{:<66} # {}'.format(test_name, reason) if reason
else test_name)
print(line, file=file)
Expand Down

0 comments on commit 935508f

Please sign in to comment.