`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 instance. The actual trace from the sample code in the original report has no mention of the instance:
```
TypeError: missing a required argument: 'x'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "../mock-method.example.py", line 11, in <module>
mock_bar.assert_called_once_with(7)
File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 822, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 811, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: bar(7)
Actual call: bar(7)
``` |