Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5039a3b

Browse filesBrowse files
committed
mocked scipy.fftpack properly?
1 parent 8a473f5 commit 5039a3b
Copy full SHA for 5039a3b

1 file changed

+6-25Lines changed: 6 additions & 25 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎docs/source/conf.py‎

Copy file name to clipboardExpand all lines: docs/source/conf.py
+6-25Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@
1313

1414
import 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.
1925
sys.path.insert(0,os.path.abspath('../..'))
20-
print sys.path
2126

2227
# -- General configuration -----------------------------------------------------
2328

@@ -195,27 +200,3 @@
195200
#latex_use_modindex = True
196201

197202
autodoc_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()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.