If you mock some thing, it can’t be runnable. Don’t forget it just mock object.
# side_effect will make mock method can be runable
# this can be use to reutrn_value in different arguments
>>> mock_method = mock.Mock()
>>> mock_method.side_effect = lambda x: x + 1
>>> mock_method(1)
2
>>> mock_method(2)
3
# Using PropertyMock with return_value argument
>>> with mock.patch('package.module.attribute',
new_callable=mock.PropertyMock(return_value=3))
as mock_attribute:
>>> print(mock_attribte)
>>> print(package.module.attribute)
3
3