Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
CPython create_autospec does not work with cyfunctions #3143
Cython functions are not compatible with unittest.mock's
I'm not super familiar with the inner workings of cython and how it integrates with cpython, but getting the functions to work seems like the responsibility of cython, not cpython.
CPython's unittest.mock uses FunctionTypes, a tuple with 2 objects, to determine if an object is callable for the purposes of automatically creating a mock object.
Should Cython patch FunctionTypes to also include cyfunction types? Or is there a better way of making this change?
I think the best way to do this is to make
Pointers on what to modify in cython's code base are welcome!