Message258575
In inspect checking that __code__ is a code object, or that co_flags is an int, would be better than special casing mock.
However, the patch to mock looks reasonable to me. It copies the whole code object from the original function to the mock object. The patch needs a test (I'd like to see a test for the Mock(func) case and the create_autospec(func) case.) |
|
Date |
User |
Action |
Args |
2016-01-19 09:39:28 | michael.foord | set | recipients:
+ michael.foord, gvanrossum, vstinner, yselivanov, miyakogi |
2016-01-19 09:39:28 | michael.foord | set | messageid: <1453196368.14.0.739879034236.issue26140@psf.upfronthosting.co.za> |
2016-01-19 09:39:28 | michael.foord | link | issue26140 messages |
2016-01-19 09:39:27 | michael.foord | create | |
|