How to patch function's return value, but still get it's side effects in python unittest

前端 未结 0 1318
梦谈多话
梦谈多话 2021-02-12 13:43

I want to patch a function\'s return value in a unittest (it is originally expensive to evaluate), but still test its side effect (setting an attribute). The code looks sth like

相关标签:
回答
  • 消灭零回复
提交回复
热议问题