[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-16 Thread Tal Einat
Tal Einat added the comment: Thanks everyone for seeing this through! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-13 Thread Lisa Roach
Lisa Roach added the comment: New changeset 2bdd5858e3f89555c8de73a0f307d63536129dbd by Lisa Roach (Susan Su) in branch 'master': bpo-35500: align expected and actual calls on mock.assert_called_with error message. (GH-11804) https://github.com/python/cpython/commit/2bdd5858e3f89555c8de73a0f

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-13 Thread Tal Einat
Tal Einat added the comment: Susan, I agree that similarly improving the failure message for assert_called_with would be good. I find the final "Not called" line unclear, though. Perhaps something like the following: AssertionError: expected call not found. Expected: mock(1, 2, 3, 4) Actual

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-12 Thread Susan Su
Susan Su added the comment: 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 "", line 1, i

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-10 Thread Tal Einat
Tal Einat added the comment: After more thought, I agree that it isn't worth changing the current wording from "Actual" to something else. -- ___ Python tracker ___ _

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think "Actual" is more consistent with other error messages like assert_has_calls. I haven't seen usage of observed or received in error messages and hence my opinion on using expected and actual though they are not visually aligned. I don't have

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Tal Einat
Tal Einat added the comment: Karthikeyan, what do you think of the suggestions by Terry and myself to achieve alignment by replacing the word "Actual" with a longer alternative, such as "Observed" or "Received"? -- ___ Python tracker

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Tal Einat
Change by Tal Einat : -- pull_requests: -11816, 11817, 11818 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Tal Einat
Change by Tal Einat : -- pull_requests: -11816, 11817 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Tal Einat
Change by Tal Einat : -- pull_requests: -11816 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch, patch, patch, patch pull_requests: +11815, 11816, 11817, 11818 stage: test needed -> patch review ___ Python tracker ___

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch, patch, patch pull_requests: +11815, 11816, 11817 stage: test needed -> patch review ___ Python tracker ___ __

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +11815 stage: test needed -> patch review ___ Python tracker ___ ___ Py

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-02-09 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch, patch pull_requests: +11815, 11816 stage: test needed -> patch review ___ Python tracker ___

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-01-29 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Cheryl, this is a good first issue for new contributor. I was waiting for suggestion and I am not sure if there is a consensus over the format. I would like to go with the below format as per suggestion from Mario and Terry. AssertionError: expecte

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-01-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: @xtreak, were you going to submit a pull request for this or do you think this would be a 'good first issue' for a new contributor? -- nosy: +cheryl.sabella ___ Python tracker

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-01-02 Thread Terry J. Reedy
Terry J. Reedy added the comment: "Expected" and "Observed" seem good. I like "Received" slightly better, but would not argue with PR author. It depends on whether one anthropomorphizes the assert function (or test machinery) as saying 'I expected to see' or 'I expected to get'. -

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2019-01-02 Thread Tal Einat
Tal Einat added the comment: Perhaps "expected" and "observed" or "detected"? -- nosy: +taleinat ___ Python tracker ___ ___ Python-

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-24 Thread Chris Withers
Change by Chris Withers : -- Removed message: https://bugs.python.org/msg332464 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-24 Thread Chris Withers
Change by Chris Withers : -- Removed message: https://bugs.python.org/msg332462 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-24 Thread Adnan Umer
Adnan Umer added the comment: Please ignore my above message. I accidentally added that here. Sorry :( -- ___ Python tracker ___ __

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-24 Thread Adnan Umer
Adnan Umer added the comment: When a method/bounded function is mocked and side_effect is supplied to it, the side_effect function doesn't get the reference to the instance. Suppose we have something like this class SomeClass: def do_something(self, x): pass def some_function(x

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-22 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks for the feedback. I personally prefer 'expected' than 'expect' though it comes at the cost that this cannot be aligned with 'actual'. Other places use 'expected' and it reads more natural in test case scenarios. -- _

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: We don't usually wrap error messages, but this is plausible. With the addition to the first line, we don't need to repeat 'call'. We can line things up without violating the PEP 8 recommendation against doing so with spaces. Also, the convention is to not

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-15 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Thanks Mario for the feedback. The alignment was just a personal preference of mine. I agree with you on adding "Expected call not found" next to AssertionError. I will wait if others have more feedback on this before proceeding on the PR. ---

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-15 Thread Mario Corchero
Mario Corchero added the comment: Makes sense! I'd not align them though but that might be my view as I generally don't like aligning text like that. Also if you feel that the exceptions read "weird" with the first sentence is empty, an option might be to say the calls don't match, to make

[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-14 Thread Karthikeyan Singaravelan
New submission from Karthikeyan Singaravelan : Currently, assert_called_with has expected calls list in the same line with AssertionError that causes the visualizing the difference to be hard. It will be great if Expected call occurs on the next line so that the diff is improved. The change h