Skip to content

Commit a4c8990

Browse files
committed
readthedoc mock trick
1 parent c1a9cb2 commit a4c8990

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/source/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@
1818
import sphinx_gallery
1919

2020
# !!!! allow readthedoc compilation
21-
from unittest.mock import MagicMock
21+
try:
22+
from unittest.mock import MagicMock
23+
except ImportError:
24+
from mock import Mock as MagicMock
25+
## check whether in the source directory...
26+
#
27+
2228
sys.path.insert(0, os.path.abspath("../.."))
2329
class Mock(MagicMock):
2430
@classmethod

0 commit comments

Comments
 (0)