Pytest patch not returning expected value I am using Pytest to mock a function whose return value is defined in another function.