Author michael.foord
Recipients berker.peksag, michael.foord, pkoning, python-dev, quasipedia, rbcollins
Date 2015-07-23.13:34:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437658460.01.0.903172093701.issue21750@psf.upfronthosting.co.za>
In-reply-to
Content
So the problem with the testing-cabal issue 280 is *really* a problem with decorators - the decorator is applied at method creation time and mock_open is only called once rather than once *per call*.

Better would be to use mock.patch as a context manager inside the test, so that mock_open is (correctly) called each time.

From a purist point of view I think that the Python 3.5==mock 1.1.4 behaviour is *better*. Whether that's enough justification to break existing code is a difficult question.
History
Date User Action Args
2015-07-23 13:34:20michael.foordsetrecipients: + michael.foord, rbcollins, python-dev, quasipedia, berker.peksag, pkoning
2015-07-23 13:34:20michael.foordsetmessageid: <1437658460.01.0.903172093701.issue21750@psf.upfronthosting.co.za>
2015-07-23 13:34:19michael.foordlinkissue21750 messages
2015-07-23 13:34:19michael.foordcreate