Redis – Mock default parameter value in inner function
I have the following (simplified) piece of code: def get_redis() return redis_instance def bar(key, value, redis=get_redis()) redis.set(key, value) def foo() bar("key", value) In my test I want to mock the function get_redis to return an instance of fakeredis.FakeStrictRedis(), so I…