Skip to content

Commit

Permalink
Mock-out shapely
Browse files Browse the repository at this point in the history
  • Loading branch information
gplessm committed Jul 22, 2017
1 parent 84b7c1f commit e2c76bb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import sys
import os
import shlex
# from unittest.mock import MagicMock
from unittest.mock import MagicMock

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -157,14 +157,14 @@

# Fix import error of modules which depend on C modules (mock out the imports for these modules)
# see http://read-the-docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
# class Mock(MagicMock):
# @classmethod
# def __getattr__(cls, name):
# return MagicMock()
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()

#MOCK_MODULES = ['libgeos', 'geos', 'libgeos_c', 'geos_c']
# MOCK_MODULES = ['shapely', 'shapely.wkt', 'shapely.wkb', 'shapely.geometry', 'shapely.ops']
# sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
MOCK_MODULES = ['shapely', 'shapely.wkt', 'shapely.wkb', 'shapely.geometry', 'shapely.ops']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)


# -- Options for HTML output ----------------------------------------------
Expand Down

0 comments on commit e2c76bb

Please sign in to comment.