New submission from Ignacio Rossi:
The following fails on python 3.4.2, 3.4.3 and 3.5.0a2 (downloaded from
python.org and compiled on Ubuntu 14.04).
The same happens when using mock.patch with autospec=True.
>>> from unittest.mock import create_autospec
>>> def functi
Ignacio Rossi added the comment:
The problem only affects autospecced functions.
Apparently, the problem lies here (all code excerpts from Lib/unittest/mock.py):
- When autospeccing functions, the Mock._mock_delegate field is populated at
the end of _setup_func (and its the only place I found