File tree Expand file tree Collapse file tree
Open diff view settings
Expand file tree Collapse file tree
Open diff view settings
Original file line number Diff line number Diff line change 1313
1414import sys , os
1515
16+ import mock
17+
18+ MOCK_MODULES = ['numpy' , 'scipy' , 'scipy.fftpack' ]
19+ for mod_name in MOCK_MODULES :
20+ sys .modules [mod_name ] = mock .Mock ()
21+
1622# If extensions (or modules to document with autodoc) are in another directory,
1723# add these directories to sys.path here. If the directory is relative to the
1824# documentation root, use os.path.abspath to make it absolute, like shown here.
1925sys .path .insert (0 ,os .path .abspath ('../..' ))
20- print sys .path
2126
2227# -- General configuration -----------------------------------------------------
2328
195200#latex_use_modindex = True
196201
197202autodoc_member_order = 'bysource'
198-
199- import sys
200-
201- class Mock (object ):
202- def __init__ (self , * args , ** kwargs ):
203- pass
204-
205- def __call__ (self , * args , ** kwargs ):
206- return Mock ()
207-
208- @classmethod
209- def __getattr__ (cls , name ):
210- if name in ('__file__' , '__path__' ):
211- return '/dev/null'
212- elif name [0 ] == name [0 ].upper ():
213- mockType = type (name , (), {})
214- mockType .__module__ = __name__
215- return mockType
216- else :
217- return Mock ()
218-
219- MOCK_MODULES = ['scipy.fftpack' ]
220- for mod_name in MOCK_MODULES :
221- sys .modules [mod_name ] = Mock ()
You can’t perform that action at this time.
0 commit comments