[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2019-08-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I proposed a PR for issue36871 which has the same issue with constructor signature being used for method calls when specced. I also checked the patch with the examples reported here regarding signature mismatch and they seem to be fixed. So

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2019-03-02 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: eat_self is also a problem as mentioned and would help in solving issue27715 where self is not ignored. I tried a patch for issue27715 but that would require changing the output of some functions that take _eat_self as a parameter to return

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2019-03-02 Thread Mario Corchero
Mario Corchero added the comment: Quite a tricky bug! Indeed @xtreak the `_call_matcher` is using the `__init__` signature. I think this is a bug introduced in https://bugs.python.org/issue17015. There is a mix of the fact that spec in Mock also can accept classes (not instances) whilst

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2019-03-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: @guboi72 is right that signature for class constructor is used also for methods. Another possible solution would be that mock stores it's children in _mock_children dictionary so when a method is called then name can be used to get the relevant

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2018-09-23 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2017-11-16 Thread Guillaume Boily
Guillaume Boily added the comment: As pointed here: https://github.com/testing-cabal/mock/issues/353, this issue is related to the method assert_has_calls or probably any calls that use the method _call_matcher to match calls. Given that you mock a class and spec it, since

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2017-02-20 Thread John W.
John W. added the comment: This got a little discussion over at http://lists.idyll.org/pipermail/testing-in-python/2017-February/007012.html The current evidence seem to indicate this is indeed a bug in the implementation of assert_has_calls. --

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2017-02-13 Thread John W.
John W. added the comment: This also seems to apply to unittest.mock in Python3.4. I described my similar issue on SO: http://stackoverflow.com/questions/42212433/what-is-wrong-with-this-simple-py-test-use-case It seems like it may be the same issue described here. For reference, this is my

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2016-04-14 Thread SilentGhost
Changes by SilentGhost : -- nosy: +michael.foord ___ Python tracker ___ ___

[issue26752] Mock(2.0.0).assert_has_calls() raise AssertionError in two same calls

2016-04-14 Thread James
New submission from James: >>> import mock >>> print mock.__version__ 2.0.0 >>> = test.py from mock import Mock,call class BB(object): def __init__(self):pass def print_b(self):pass def print_bb(self,tsk_id):pass bMock = Mock(return_value=Mock(spec=BB))