You need to pass the instance in as a function parameter then. That's what dependency injection is - you take the responsibility of supplying the dependency out of the class that uses it, so that you can substitute different implementations as necessary (like here for testing).
Also, do you really need to use
Also, do you really need to use
MagicMock
? I mean, it's pretty much straightforward to define a class that has the right method and returns the value you want:class FakeClient: def get_value(self, feature_eng): return "true"Since Python has duck typing, you don't need to worry about inheriting from
AppClient