Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
attempt to use readthedocs without errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zalun committed Dec 5, 2011
1 parent 7d21cba commit 464c53b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,24 @@ def __getattr__(self, name):
return Mock


MOCK_MODULES = ['MySQLdb', 'MySQLdb.constants', 'statsd', 'commonware', 'commonware.log']
MOCK_MODULES = [
'MySQLdb', 'MySQLdb.constants', 'MySQLdb.converters',
'MySQLdb.constants.FIELD_TYPE',
'statsd', 'commonware', 'commonware.log']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()

setattr(sys.modules['MySQLdb'], 'version_info', (1, 2, 2))
setattr(sys.modules['MySQLdb.constants'], 'FIELDTYPE', Mock())
setattr(sys.modules['MySQLdb.constants'], 'FIELD_TYPE', Mock())
setattr(sys.modules['MySQLdb.converters'], 'conversions', Mock())
setattr(sys.modules['commonware'], 'log', Mock())
setattr(sys.modules['commonware.log'], 'getLogger', Mock())

MySQLdbFIELDTYPES = ['BLOB']

for fieldtype in MySQLdbFIELDTYPES:
setattr(sys.modules['MySQLdb.constants.FIELD_TYPE'], fieldtype, Mock())

os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down

0 comments on commit 464c53b

Please sign in to comment.