pythonmox

How to mock method call without signature check?


I use mox to mock an object. I need to record method call but the method receives a lot of arguments I am not intetested in, and some of this arguments are not primitive types but instances of classes created somewhere else.

I want to avoid the check for passed arguments. How to?


Solution

  • You can achieve this using mox comparators, in particular IgnoreArg(). Please refer to the documentation: https://code.google.com/p/pymox/wiki/MoxDocumentation#Comparators