Message287728
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 repro case:
from unittest.mock import patch, call
class Foo:
def __init__(self):
pass
def my_method(self, value):
pass
def test_foo():
with patch('test.Foo', autospec=True) as MockFoo:
m = MockFoo()
m.my_method(123)
MockFoo.assert_has_calls([call(), call().my_method(123)])
It fails with:
...
E AssertionError: Calls not found.
E Expected: [call(), call().my_method(123)]
E Actual: [call(), call().my_method(123)]
Which seems nonsensical to me.
Removing the `value` parameter and the `123` arguments in the test makes it pass(!) |
|
| Date |
User |
Action |
Args |
| 2017-02-13 21:54:02 | jwdevel | set | recipients:
+ jwdevel, rbcollins, michael.foord, jekin000 |
| 2017-02-13 21:54:01 | jwdevel | set | messageid: <1487022841.93.0.27570819549.issue26752@psf.upfronthosting.co.za> |
| 2017-02-13 21:54:01 | jwdevel | link | issue26752 messages |
| 2017-02-13 21:54:01 | jwdevel | create | |
|