mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-04-27 05:46:24 +02:00
Add just pylab mock back
This commit is contained in:
parent
d63cd4ad7e
commit
9758c90b16
1 changed files with 20 additions and 20 deletions
40
doc/conf.py
40
doc/conf.py
|
|
@ -326,26 +326,26 @@ epub_copyright = u'2013, Author'
|
|||
##############################################################################
|
||||
##
|
||||
## Mock out imports with C dependencies because ReadTheDocs can't build them.
|
||||
#class Mock(object):
|
||||
#def __init__(self, *args, **kwargs):
|
||||
#pass
|
||||
class Mock(object):
|
||||
def __init__(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
#def __call__(self, *args, **kwargs):
|
||||
#return Mock()
|
||||
def __call__(self, *args, **kwargs):
|
||||
return Mock()
|
||||
|
||||
#@classmethod
|
||||
#def __getattr__(cls, name):
|
||||
#if name in ('__file__', '__path__'):
|
||||
#return '/dev/null'
|
||||
#elif name[0] == name[0].upper():
|
||||
#mockType = type(name, (), {})
|
||||
#mockType.__module__ = __name__
|
||||
#return mockType
|
||||
#else:
|
||||
#return Mock()
|
||||
@classmethod
|
||||
def __getattr__(cls, name):
|
||||
if name in ('__file__', '__path__'):
|
||||
return '/dev/null'
|
||||
elif name[0] == name[0].upper():
|
||||
mockType = type(name, (), {})
|
||||
mockType.__module__ = __name__
|
||||
return mockType
|
||||
else:
|
||||
return Mock()
|
||||
|
||||
#MOCK_MODULES = [#'matplotlib', 'matplotlib.pyplot',
|
||||
#'pylab'
|
||||
#]
|
||||
#for mod_name in MOCK_MODULES:
|
||||
#sys.modules[mod_name] = Mock()
|
||||
MOCK_MODULES = [#'matplotlib', 'matplotlib.pyplot',
|
||||
'pylab'
|
||||
]
|
||||
for mod_name in MOCK_MODULES:
|
||||
sys.modules[mod_name] = Mock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue