[issue27715] call-matcher breaks if a method is mocked with spec=True

2018-12-14 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think the original issue with patch.object reported by Carl is different from the one reported by David for autospec. Analyzed the report by David and When we call autospec on a class with instance=True then the spec is modeled on the signature o

[issue27715] call-matcher breaks if a method is mocked with spec=True

2018-12-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak versions: +Python 3.7, Python 3.8 -Python 3.4, Python 3.5 ___ Python tracker ___ _

[issue27715] call-matcher breaks if a method is mocked with spec=True

2018-07-11 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- type: crash -> behavior ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue27715] call-matcher breaks if a method is mocked with spec=True

2017-07-27 Thread David Hoyes
David Hoyes added the comment: I came across a different failing test case, which looks a lot like the same issue: ``` from unittest import mock class Foo(object): def __call__(self, x): return x m = mock.create_autospec(Foo, instance=True) m(7) m.assert_called_once_with(7) ``` I

[issue27715] call-matcher breaks if a method is mocked with spec=True

2017-02-02 Thread jordan-pittier
jordan-pittier added the comment: I stumbled onto this today. I can confirm the issue. -- nosy: +jordan-pittier ___ Python tracker ___ ___

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-09-11 Thread Eli_B
Changes by Eli_B : -- nosy: +Eli_B ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mail

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer
Carl Meyer added the comment: `hg clean --all` resolved the compilation issues; confirmed that https://hg.python.org/cpython/rev/b888c9043566/ is at fault. Also, the exception trace I provided above looks wrong; it must be from when I was messing about with `autospec=True` or passing in the in

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer
Changes by Carl Meyer : Removed file: http://bugs.python.org/file44054/mock-method.example.py ___ Python tracker ___ ___ Python-bugs-list mail

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer
Carl Meyer added the comment: It seems likely that this regression originated with https://hg.python.org/cpython/rev/b888c9043566/ (can't confirm via bisection as the commits around that time fail to compile for me). -- nosy: +michael.foord, pitrou

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer
Carl Meyer added the comment: (This bug is also present in Python 3.4.4.) -- type: -> crash versions: +Python 3.4 ___ Python tracker ___

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer
New submission from Carl Meyer: When constructing call-matchers to match expected vs actual calls, if `spec=True` was used when patching a function, mock attempts to bind the recorded (and expected) call args to the function signature. But if a method was mocked, the signature includes `self`