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 fried
Recipients Dima.Tisnek, asvetlov, fried, lisroach, xtreak
Date 2020-02-17.22:59:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581980343.37.0.269137342263.issue38857@roundup.psfhosted.org>
In-reply-to
Content
Its not possible to have it both ways.  Also it stinks too much of trying to guess. 

The root of your issue is you want a normal MagicMock not an AsyncMock. Its the automatic behavior of patch to pick AsyncMock vs MagicMock that is the heart of your issue.  This bug fix doesn't involve that behavior at all, and AsyncMock was measurably broken without the fix, in an unavoidable way.  Your breakage is avoidable by changes to how you patch.  

 with patch("bar", return_value=42)

To still do it the old way you would have to pass new_callable=MagicMock to patch.
History
Date User Action Args
2020-02-17 22:59:03friedsetrecipients: + fried, asvetlov, Dima.Tisnek, lisroach, xtreak
2020-02-17 22:59:03friedsetmessageid: <1581980343.37.0.269137342263.issue38857@roundup.psfhosted.org>
2020-02-17 22:59:03friedlinkissue38857 messages
2020-02-17 22:59:03friedcreate