This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author David Hoyes
Recipients David Hoyes, Eli_B, carljm, jordan-pittier, michael.foord, pitrou
Date 2017-07-27.15:44:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501170255.24.0.0254627180696.issue27715@psf.upfronthosting.co.za>
In-reply-to
Content
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)
```
History
Date User Action Args
2017-07-27 15:44:15David Hoyessetrecipients: + David Hoyes, pitrou, carljm, michael.foord, Eli_B, jordan-pittier
2017-07-27 15:44:15David Hoyessetmessageid: <1501170255.24.0.0254627180696.issue27715@psf.upfronthosting.co.za>
2017-07-27 15:44:15David Hoyeslinkissue27715 messages
2017-07-27 15:44:15David Hoyescreate