calltracker Decorator
Decorator method that adds has_been_called
attribute to decorated method.
has_been_called
is False
if method has not been called.
has_been_called
is True
if method has been called.
Note
This decorator needs to be the topmost decorator applied to a method
Example
>>> @calltracker
>>> def foo(msg):
>>> print(msg)
>>> print(foo.has_been_called)
False
>>> foo("Hello World")
Hello World
>>> print(foo.has_been_called)
True
See also