#209 try the RTD solution with Mock objects
See https://docs.readthedocs.io/en/stable/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules Tested locally ok.
This commit is contained in:
committed by
GitHub
parent
1bfe0e3bf4
commit
f2cf004d2a
@@ -19,6 +19,18 @@
|
||||
#
|
||||
import os
|
||||
import sys
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
|
||||
class Mock(MagicMock):
|
||||
@classmethod
|
||||
def __getattr__(cls, name):
|
||||
return MagicMock()
|
||||
|
||||
|
||||
MOCK_MODULES = ['osgeo', 'psycopg2.sql', 'elasticsearch']
|
||||
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
|
||||
|
||||
sys.path.insert(0, os.path.abspath('../..'))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user