Skip to content

Commit

Permalink
other mock processing
Browse files Browse the repository at this point in the history
  • Loading branch information
mjirik committed Jan 27, 2015
1 parent c2b0b18 commit 52a7330
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,25 @@
sys.path.insert(0, os.path.abspath('../'))

# mock
from unittest.mock import MagicMock
import mock

MOCK_MODULES = ['numpy', 'scipy', 'matplotlib', 'matplotlib.pyplot',
'scipy.interpolate']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()

# from unittest.mock import MagicMock
#
# class Mock(MagicMock):
# @classmethod
# def __getattr__(cls, name):
# return Mock()
#
# MOCK_MODULES = ['pygtk', 'gtk', 'gobject', 'argparse', 'numpy', 'pandas',
# 'scipy']
# sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return Mock()

MOCK_MODULES = ['pygtk', 'gtk', 'gobject', 'argparse', 'numpy', 'pandas',
'scipy']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down

0 comments on commit 52a7330

Please sign in to comment.