Configure importing Mock to handle 'total' method from psutils properly

This commit is contained in:
Bo Maryniuk 2016-08-25 16:48:34 +02:00
parent 9c057d0266
commit a56ae4e8f5

View File

@ -141,7 +141,11 @@ MOCK_MODULES = [
]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
if mod_name == 'psutil':
mock = Mock(mapping={'total': 0}) # Otherwise it will crash Sphinx
else:
mock = Mock()
sys.modules[mod_name] = mock
def mock_decorator_with_params(*oargs, **okwargs):
'''