mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Swapping manual mocking to autodoc_mock_imports
This commit is contained in:
parent
59809a1e1b
commit
0d65304350
1 changed files with 1 additions and 18 deletions
19
doc/conf.py
19
doc/conf.py
|
@ -178,12 +178,7 @@ MOCK_MODULES = [
|
|||
'msgpack',
|
||||
]
|
||||
|
||||
for mod_name in MOCK_MODULES:
|
||||
if mod_name == 'psutil':
|
||||
mock = Mock(mapping={'total': 0}) # Otherwise it will crash Sphinx
|
||||
else:
|
||||
mock = Mock()
|
||||
sys.modules[mod_name] = mock
|
||||
autodoc_mock_imports = MOCK_MODULES
|
||||
|
||||
def mock_decorator_with_params(*oargs, **okwargs):
|
||||
'''
|
||||
|
@ -202,18 +197,6 @@ def mock_decorator_with_params(*oargs, **okwargs):
|
|||
return Mock()
|
||||
return inner
|
||||
|
||||
# Define a fake version attribute for the following libs.
|
||||
sys.modules['libcloud'].__version__ = '0.0.0'
|
||||
sys.modules['msgpack'].version = (1, 0, 0)
|
||||
sys.modules['psutil'].version_info = (3, 0, 0)
|
||||
sys.modules['pymongo'].version = '0.0.0'
|
||||
sys.modules['ntsecuritycon'].STANDARD_RIGHTS_REQUIRED = 0
|
||||
sys.modules['ntsecuritycon'].SYNCHRONIZE = 0
|
||||
|
||||
# Define a fake version attribute for the following libs.
|
||||
sys.modules['cherrypy'].config = mock_decorator_with_params
|
||||
|
||||
|
||||
# -- Add paths to PYTHONPATH ---------------------------------------------------
|
||||
try:
|
||||
docs_basepath = os.path.abspath(os.path.dirname(__file__))
|
||||
|
|
Loading…
Add table
Reference in a new issue