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 mariocj89, vstinner
Date 2017-06-01.21:00:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Sample implementation using the new class:

Sample implementation using the new function to seal existing mocks:

Happy to submit a PR if the idea is accepted.

The only benefit I see from the using a separate class is that you will be able to do:

>>> m = mock.SealedMock()
>>> m.important_attr = 42
>>> m.freeflow_attribute = mock.Mock()
>>> mock.seal(m)

which will allow to define "subparts of the mock" without the sealing.

That said I still prefer the function implementation as it looks much nicer (credit to Victor Stinner for the idea)
Date User Action Args
2017-06-01 21:00:59mariocj89setrecipients: + mariocj89, vstinner
2017-06-01 21:00:59mariocj89setmessageid: <>
2017-06-01 21:00:59mariocj89linkissue30541 messages
2017-06-01 21:00:59mariocj89create