Skip to content

Instantly share code, notes, and snippets.

@jcollado
Created August 24, 2011 06:54
Show Gist options
  • Save jcollado/1167446 to your computer and use it in GitHub Desktop.
Save jcollado/1167446 to your computer and use it in GitHub Desktop.
Mocking modules to prevent sphinx.ext.autodoc from failing on import
class Mock(object):
def __init__(self, *args):
pass
def __getattr__(self, name):
return Mock
for mod_name in ('pygtk', 'gtk', 'gobject', 'argparse'):
sys.modules[mod_name] = Mock()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment