Suppose you want to want to track all calls (args, kwargs and result) made to a given method while running a command, you can do it using the simple decorator defined in the spy.py
module of this gist.
You can use it to spy either on a single instance or to all instances of given class.
The calls will be stored in a list that must be passed by instantiated beforehand and passed to the decorator.