from unittest import mock

class MyClass(object):
    def __int__(self):
        self.my_attribute = 10

    @property
    def my_property(self):
        return self.my_attribute + 1

def unit_under_test():
    inst = MyClass()
    return inst.my_property

class MyMock(mock.PropertyMock):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        print("MyMock __init__ called.")

with mock.patch.object(mock, 'MagicMock', MyMock) as property_mock:
    with mock.patch.object(MyClass, 'my_property', autospec=True) as spy:
        property_mock.side_effect = lambda self: 2
        # or property_mock.return_value = 2
        result = unit_under_test()
        assert result == 2
        assert spy.call_count == 1