summaryrefslogtreecommitdiff
path: root/src/mailman/testing/helpers.py
diff options
context:
space:
mode:
authorMark Sapiro2016-10-22 12:24:00 -0700
committerMark Sapiro2016-10-22 12:24:00 -0700
commitcbb0847d59fb8b77f634a7209b0dc8170023b6f5 (patch)
tree2469f7eb074a4ab6d9579133987b7fde503732a4 /src/mailman/testing/helpers.py
parentd1954d1705a987524bb25ecb8cdbace6de56fa5b (diff)
parent3cf613f56e44bed4bc45f533e6f6263288e66460 (diff)
downloadmailman-cbb0847d59fb8b77f634a7209b0dc8170023b6f5.tar.gz
mailman-cbb0847d59fb8b77f634a7209b0dc8170023b6f5.tar.zst
mailman-cbb0847d59fb8b77f634a7209b0dc8170023b6f5.zip
Diffstat (limited to 'src/mailman/testing/helpers.py')
-rw-r--r--src/mailman/testing/helpers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py
index 6496484ca..d9cf974f5 100644
--- a/src/mailman/testing/helpers.py
+++ b/src/mailman/testing/helpers.py
@@ -18,6 +18,7 @@
"""Various test helpers."""
import os
+import sys
import json
import time
import uuid
@@ -118,8 +119,11 @@ def get_queue_messages(queue_name, sort_on=None, expected_count=None):
messages.append(_Bag(msg=msg, msgdata=msgdata))
queue.finish(filebase)
if expected_count is not None:
- assert len(messages) == expected_count, 'Wanted {}, got {}'.format(
- expected_count, len(messages))
+ if len(messages) != expected_count:
+ for item in messages:
+ print(item.msg, file=sys.stderr)
+ raise AssertionError('Wanted {}, got {}'.format(
+ expected_count, len(messages)))
if sort_on is not None:
messages.sort(key=lambda item: str(item.msg[sort_on]))
return messages