def test_no_memoize(): fn = Mock(__name__="fn") memoized = memoize(fn) memoized() memoized() assert fn.call_count == 2
def test_no_memoize(): fn = Mock(__name__='fn') memoized = memoize(fn) memoized() memoized() assert fn.call_count == 2
def test_memoize(): fn = Mock(__name__="fn") memoized = memoize(fn) memoized() memoized() fn.assert_called_once_with()
def test_memoize(): fn = Mock(__name__='fn') memoized = memoize(fn) memoized() memoized() fn.assert_called_once_with()