Skip to content

Commit

Permalink
try RTD fix: use mock_qtwidgets.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jborbely committed Aug 31, 2017
1 parent 77100e2 commit d3e10d7
Show file tree
Hide file tree
Showing 2 changed files with 587 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
html_theme = 'default'

from unittest.mock import MagicMock
from . import mock_qtwidgets

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

MOCK_MODULES = ['PyQt5', 'PyQt5.QtWidgets', 'PyQt5.QtCore', 'PyQt5.QtGui', 'sip']
MOCK_MODULES = ['PyQt5', 'PyQt5.QtCore', 'PyQt5.QtGui']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
sys.modules.update((('PyQt5.QtWidgets', mock_qtwidgets),))

else:
html_theme = 'sphinx_rtd_theme'
Expand Down

0 comments on commit d3e10d7

Please sign in to comment.