def test_memoised_mutable_return_value():
    'Avoid side effects for returned mutable arguments when memoising.'
    memoiser = ftrack_api.cache.Memoiser()
    arguments = ({'called': False}, 1)
    result_a = memoiser.call(function, arguments)
    assert (result_a == {'result': 3})
    assert arguments[0]['called']
    del result_a['result']
    arguments[0]['called'] = False
    result_b = memoiser.call(function, arguments)
    assert (result_b == {'result': 3})
    assert (not arguments[0]['called'])
Avoid side effects for returned mutable arguments when memoising.
def test_memoised_mutable_return_value():
    
    memoiser = ftrack_api.cache.Memoiser()
    arguments = ({'called': False}, 1)
    result_a = memoiser.call(function, arguments)
    assert (result_a == {'result': 3})
    assert arguments[0]['called']
    del result_a['result']
    arguments[0]['called'] = False
    result_b = memoiser.call(function, arguments)
    assert (result_b == {'result': 3})
    assert (not arguments[0]['called'])