зеркало из https://github.com/mozilla/FlightDeck.git
attempt to use readthedocs without errors
This commit is contained in:
Родитель
7d21cba1b3
Коммит
464c53b755
|
@ -45,15 +45,24 @@ class Mock(object):
|
|||
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче