Author suhearsawho
Recipients Adnan Umer, cheryl.sabella, cjw296, mariocj89, michael.foord, suhearsawho, taleinat, terry.reedy, xtreak
Date 2019-02-13.07:43:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550043819.14.0.00842487555645.issue35500@roundup.psfhosted.org>
In-reply-to
Content
After taking a look at the assert_called_with function, I noticed that the formatting is inconsistent for the following case:
from unittest import mock

m = mock.Mock()
a = [1, 2, 3, 4]
m.assert_called_with(*a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/vagrant/cpython/Lib/unittest/mock.py", line 817, in assert_called_with
    raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: mock(1, 2, 3)
Not called


If you believe it would be appropriate, I would like to change the format of the code above to the following:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/vagrant/cpython/Lib/unittest/mock.py", line 817, in assert_called_with
    raise AssertionError(
AssertionError: expected call not found.
Expected: mock(1, 2, 3, 4)
Not called

This way, we would create consistency in our output.
History
Date User Action Args
2019-02-13 07:43:39suhearsawhosetrecipients: + suhearsawho, terry.reedy, taleinat, cjw296, michael.foord, cheryl.sabella, mariocj89, xtreak, Adnan Umer
2019-02-13 07:43:39suhearsawhosetmessageid: <1550043819.14.0.00842487555645.issue35500@roundup.psfhosted.org>
2019-02-13 07:43:39suhearsawholinkissue35500 messages
2019-02-13 07:43:39suhearsawhocreate