Mock attributes and functions for objects you need quickly in a test

>>> def do_print(x):
...     print x

>>> apple = type("", (), {'pips':7, 'bite':lambda s:do_print('Munch!')})()
>>> apple.pips
7
>>> apple.bite()
Munch!