diff options
| author | Barry Warsaw | 2016-09-13 19:43:34 +1200 |
|---|---|---|
| committer | Barry Warsaw | 2016-09-13 19:43:34 +1200 |
| commit | 74c7d6d1d089864fe01a3f2502314c31508a4781 (patch) | |
| tree | 13ebba81466850b64b4fb909018aa09694806d8f /src/mailman/testing | |
| parent | e18e7ac34e8b4b2f88d5987ccb76a39c54c61c0c (diff) | |
| download | mailman-74c7d6d1d089864fe01a3f2502314c31508a4781.tar.gz mailman-74c7d6d1d089864fe01a3f2502314c31508a4781.tar.zst mailman-74c7d6d1d089864fe01a3f2502314c31508a4781.zip | |
Diffstat (limited to 'src/mailman/testing')
| -rw-r--r-- | src/mailman/testing/helpers.py | 8 |
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 |
