Skip to content

Commit

Permalink
Mock LMDB import.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano Cossu committed Mar 30, 2018
1 parent cf2fc14 commit ad74aad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#
import os
import sys

from unittest.mock import MagicMock

#sys.path.insert(0, os.path.abspath('../'))
sys.path.append(os.path.abspath('../'))
import lakesuperior.env_setup
Expand Down Expand Up @@ -176,3 +179,12 @@

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

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

MOCK_MODULES = ['lmdb']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

0 comments on commit ad74aad

Please sign in to comment.