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 <>
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)

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/", line 12, in <module>
  File "/usr/lib/python3.5/unittest/", line 803, in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
  File "/usr/lib/python3.5/unittest/", 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:15David Hoyessetrecipients: + David Hoyes, pitrou, carljm, michael.foord, Eli_B, jordan-pittier
2017-07-27 15:44:15David Hoyessetmessageid: <>
2017-07-27 15:44:15David Hoyeslinkissue27715 messages
2017-07-27 15:44:15David Hoyescreate