Message299319
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)
```
In mock 1.0.1 this passes, but in Python 3.5 we get this error:
```
TypeError: missing a required argument: 'x'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "euhpc/tmp/mockbug.py", line 12, in <module>
m.assert_called_once_with(7)
File "/usr/lib/python3.5/unittest/mock.py", line 803, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
File "/usr/lib/python3.5/unittest/mock.py", line 792, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: mock(7)
Actual call: mock(7)
``` |
|
Date |
User |
Action |
Args |
2017-07-27 15:44:15 | David Hoyes | set | recipients:
+ David Hoyes, pitrou, carljm, michael.foord, Eli_B, jordan-pittier |
2017-07-27 15:44:15 | David Hoyes | set | messageid: <1501170255.24.0.0254627180696.issue27715@psf.upfronthosting.co.za> |
2017-07-27 15:44:15 | David Hoyes | link | issue27715 messages |
2017-07-27 15:44:15 | David Hoyes | create | |
|