On 3/11/2014 6:13 PM, John Gordon wrote:
In <[email protected]> Ethan Furman
<[email protected]> writes:
if missing:
raise ValueError('invoices %r missing from batch' % missing)
It's been a while since I wrote test cases, but I recall using the assert*
methods (assertEqual, assertTrue, etc.) instead of raising exceptions.
Perhaps that's the issue?
Yes. I believe the methods all raise AssertionError on failure, and the
test methods are wrapped with try:.. except AssertionError as err:
if missing:
raise ValueError('invoices %r missing from batch' % missing)
should be "assertEqual(missing, [], 'invoices missing from batch')" and
if that fails, the non-empty list is printed along with the message.
--
Terry Jan Reedy
--
https://mail.python.org/mailman/listinfo/python-list