Skip to content

Commit 1f6b39f

Browse files
committed
Updated.
1 parent c7ae4c9 commit 1f6b39f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

doc/conf.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import sphinx
1717

18-
import mock
18+
from mock import Mock as MagicMock
1919

2020
#class Mock(object):
2121
# def __init__(self, *args, **kwargs):
@@ -33,12 +33,19 @@
3333
# else:
3434
# return Mock()
3535

36+
class Mock(MagicMock):
37+
@classmethod
38+
def __getattr__(cls, name):
39+
return Mock()
40+
41+
3642
MOCK_MODULES = ['numpy', 'numpy.fft', 'scipy', 'matplotlib', 'matplotlib.pyplot',
3743
'matplotlib.collections', 'matplotlib.patches',
38-
'commpy.channelcoding', 'numpy.random']
44+
'numpy.random']
3945
for mod_name in MOCK_MODULES:
4046
#sys.modules[mod_name] = Mock()
41-
sys.modules[mod_name] = mock.Mock()
47+
#sys.modules[mod_name] = mock.Mock()
48+
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
4249

4350
# If extensions (or modules to document with autodoc) are in another directory,
4451
# add these directories to sys.path here. If the directory is relative to the

0 commit comments

Comments
 (0)