提交 1058d031 编写于 作者: B Behdad Esfahbod

Make hb-diff-filter-failtures retain all test info for failed tests

上级 f1eb008c
...@@ -149,16 +149,35 @@ class ZipDiffer: ...@@ -149,16 +149,35 @@ class ZipDiffer:
class DiffFilters: class DiffFilters:
@staticmethod @staticmethod
def filter_failures (f, symbols=diff_symbols): def filter_failures (f):
for l in f: for lines in DiffHelpers.separate_test_cases (f):
if l[0] in symbols: if any (l[0] != ' ' for l in lines):
# TODO retain all lines of the failure for l in lines: yield l
yield l
class DiffHelpers:
class ShapeFilters: @staticmethod
def separate_test_cases (f):
'''Reads lines from f, and if the lines have identifiers, ie.
have a colon character, groups them by identifier,
yielding lists of all lines with the same identifier.'''
pass acc = []
iden = None
for l in f:
if ':' not in l:
if acc: yield acc
acc = []
iden = None
yield [l]
continue
l_iden = l[1:l.index (':')]
if acc and iden != l_iden:
yield acc
acc = []
iden = l_iden
acc.append (l)
if acc: yield acc
class FilterHelpers: class FilterHelpers:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册