homepage

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 mariocj89
Recipients berker.peksag, ericvw, grzgrzgrz3, mariocj89, michael.foord, rbcollins, vstinner
Date 2017年06月21日.22:15:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1498083341.89.0.0142743933101.issue30541@psf.upfronthosting.co.za>
In-reply-to
Content
Whilst I agree that using spec can be used for a similar purpose and I did not know about being able to do nested definitions via the arguments (the **{"method1.return_value": 1}, really cool!) I find the idea of allowing users to halt the mock generation really useful. It is much less disruptive and feels more natural.
Compare:
>>> inner_m = Mock(spec=["method2"], **{"method2.return_value": 1})
>>> m = Mock(spec=["method1"], **{"method1.return_value": inner_m})
with: 
>>> m = mock.Mock()
>>> m.method1().method2() = 1
>>> mock.seal(m)
In brief, seal allows users to just add the method to their existing workflow where they use generic mocks. Moreover, it is extremely user friendly, many of the developers that struggle with the mocking module found seal really helpful.
History
Date User Action Args
2017年06月21日 22:15:41mariocj89setrecipients: + mariocj89, vstinner, rbcollins, ericvw, michael.foord, berker.peksag, grzgrzgrz3
2017年06月21日 22:15:41mariocj89setmessageid: <1498083341.89.0.0142743933101.issue30541@psf.upfronthosting.co.za>
2017年06月21日 22:15:41mariocj89linkissue30541 messages
2017年06月21日 22:15:41mariocj89create

AltStyle によって変換されたページ (->オリジナル) /