Override 'is' operator for mocked object

前端 未结 0 1493
無奈伤痛
無奈伤痛 2021-01-27 22:37

I need to mock an Object that can be a number or None and test it with the is operator like this:

from unittest.mock import Mock

mock = Mock(return_         


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