[issue35226] mock.call equality surprisingly broken

2018-12-03 Thread Chris Withers
Change by Chris Withers : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue35226] mock.call equality surprisingly broken

2018-12-03 Thread Chris Withers
Chris Withers added the comment: New changeset e8f9e4785caeef8a68bb7859280e91a4cb424b79 by Chris Withers (Miss Islington (bot)) in branch '3.7': bpo-35226: Fix equality for nested unittest.mock.call objects. (GH-10555)

[issue35226] mock.call equality surprisingly broken

2018-12-03 Thread Chris Withers
Chris Withers added the comment: New changeset 67e6136a6d5c07141d4dba820c450a70db7aedd5 by Chris Withers (Miss Islington (bot)) in branch '3.6': bpo-35226: Fix equality for nested unittest.mock.call objects. (GH-10555)

[issue35226] mock.call equality surprisingly broken

2018-12-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +10118 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35226] mock.call equality surprisingly broken

2018-12-03 Thread Chris Withers
Chris Withers added the comment: New changeset 8ca0fa9d2f4de6e69f0902790432e0ab2f37ba68 by Chris Withers in branch 'master': bpo-35226: Fix equality for nested unittest.mock.call objects. (#10555) https://github.com/python/cpython/commit/8ca0fa9d2f4de6e69f0902790432e0ab2f37ba68 --

[issue35226] mock.call equality surprisingly broken

2018-12-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +10117 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35226] mock.call equality surprisingly broken

2018-12-02 Thread Daniel Fortunov
Change by Daniel Fortunov : -- nosy: +dfortunov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35226] mock.call equality surprisingly broken

2018-11-27 Thread Chris Withers
Chris Withers added the comment: Éric, doesn't look like I can add labels, what needs to happen for me to do so? (I was/am a core developer, just an extremely inactive one ;-), but happy to jump through whatever hoops necessary... ) -- ___ Python

[issue35226] mock.call equality surprisingly broken

2018-11-16 Thread Éric Araujo
Éric Araujo added the comment: Add the right «needs backport to X.Y» labels to the PR and a bot will take care of it. (This info does not seem to be in the devguide!) -- nosy: +eric.araujo ___ Python tracker

[issue35226] mock.call equality surprisingly broken

2018-11-14 Thread Chris Withers
Chris Withers added the comment: Assuming the PR is merged, what do I need to do for 3.7 and 3.6 backports? There's no doubt a doc for this somewhere, so please just point me at it :-) -- ___ Python tracker

[issue35226] mock.call equality surprisingly broken

2018-11-14 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +9798 stage: -> patch review ___ Python tracker ___ ___

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Michael Foord
Michael Foord added the comment: Parents comparing upwards sounds like the right (and simple) fix. Not breaking the tuple tests would be good. I'm happy for Chris to produce the patch. -- ___ Python tracker

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Chris Withers
Chris Withers added the comment: I'm chatting with Michael already (on Facebook of all places), and I use this feature heavily and deeply, being one of the people who originally requested it. I'm both happy and capable of seeing this through, so no need for anyone else to dive in :-)

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Mario Corchero
Mario Corchero added the comment: If this is to be done we should not change those tests, I am sure there is code validating calls relying on its "tupleness". Example: ``` >>> import unittest.mock >>> m = unittest.mock.Mock() >>> m(1) >>> m(2, a=1) >>> m.assert_has_calls([ ... ((1,),

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Yes, for call objects it's always there but some of the tests use a tuple during self.assertEquals and hence during equality check other fails with the attribute error for parent like below. Also getattr(self, 'parent', None) != getattr(other,

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Chris Withers
Chris Withers added the comment: I don't think the getattr(self, 'parent', None) is necessary, the attribute is always there and None == None ;-) I reckon this will work: if self.parent != other.parent): return True ...but obviously, we'd add some more tests to the suite to make sure

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread STINNER Victor
Change by STINNER Victor : -- nosy: +mariocj89 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think this is due to the fact that when an attribute of a call object is accessed a new call object is returned with the parent as self.parent [0] but the original information regarding the parent is lost during representation and no check for

[issue35226] mock.call equality surprisingly broken

2018-11-13 Thread Chris Withers
New submission from Chris Withers : $ python3 Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from unittest.mock import call >>> call(x=1) == call(x=2) False Good so far?