Skip to content

Commit da8c38f

Browse files
committed
Tweaked the display of testurl.list diff failures against known-good masters.
- Legacy-Id: 6494
1 parent d8e3e32 commit da8c38f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

ietf/utils/test_utils.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,15 @@ def doDiff(self, tuple, response):
231231

232232
list0 = refhtml.split("\n")
233233
list1 = testhtml.split("\n")
234-
diff = "\n".join(unified_diff(list0, list1, master or refurl, url, "", "", 0, lineterm=""))
235-
if diff:
236-
print " Differences found:"
237-
print diff
234+
diff_list = list(unified_diff(list0, list1, master or refurl, url, "", "", 0, lineterm=""))
235+
if len(diff_list):
236+
if len(diff_list) > 10:
237+
print "The diff is too long to show in its entirety. Here are the first 10 lines:\n"
238+
print "\n".join(diff_list[:16])
239+
print "..."
240+
else:
241+
print " Differences found:"
242+
print "\n".join(unified_diff(list0, list1, master or refurl, url, "", "", 0, lineterm=""))
238243
return False
239244

240245
def canonicalize_feed(s):

0 commit comments

Comments
 (0)