By \"internal function\", I mean a function that is called from within the same module it is defined in.
I am using the mock library, specifically the patch decorators,
another option is to explicitly call patch on the function:
mock.patch('function_name')
and to support both running directly or from py.test etc:
mock.patch(__name__ + '.' + 'function_name')