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 michael.foord
Recipients kushal.das, michael.foord
Date 2014-04-16.16:19:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397665155.65.0.579203534798.issue21255@psf.upfronthosting.co.za>
In-reply-to
Content
What steps will reproduce the problem?

    >>> foo = Mock(name='foo')
    >>> prop = PropertyMock(name='prop')
    >>> type(foo).prop = prop
    >>> foo.attach_mock(prop, 'prop')
    >>> foo.mock_calls
    [call.prop(<PropertyMock name='foo.prop' id='4300017296'>)]

Expected:

    >>> foo.mock_calls
    []

What version of the product are you using? On what operating system?

    % pip freeze | grep mock
    mock==1.0.1

    OS X 10.8.4

Please provide any additional information below.

    It would be even cooler if attaching a property mock made calls to the property appear in the mock_calls for the hosting mock without having to attach it, the way it does with a non-property method :)

    I use mock every day now and am firmly of the opinion it is far, far more awesome than sliced bread. Thanks for making it available to the Python community :)
History
Date User Action Args
2014-04-16 16:19:15michael.foordsetrecipients: + michael.foord, kushal.das
2014-04-16 16:19:15michael.foordsetmessageid: <1397665155.65.0.579203534798.issue21255@psf.upfronthosting.co.za>
2014-04-16 16:19:15michael.foordlinkissue21255 messages
2014-04-16 16:19:15michael.foordcreate