From a56ae4e8f50bab50b2947a37ddd42cfd1d200de4 Mon Sep 17 00:00:00 2001 From: Bo Maryniuk Date: Thu, 25 Aug 2016 16:48:34 +0200 Subject: [PATCH] Configure importing Mock to handle 'total' method from psutils properly --- doc/conf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index bc88aa041f..df75301880 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -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): '''