Skip to content

Commit

Permalink
Tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Nicholls committed Apr 16, 2019
1 parent 4e0832e commit 1fcb15a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@

# -- Mock modules ------------------------------------------------------------

# If we cannot import pytac or at then mock them. This is a temporary fix
# because at is not on pypi.
class DataSource(object):
pass

# If we cannot import pytac prooperly or at then partially or fully mock them. # This is a temporary fix because the latest versions are not yet on pypi.
import pytac
pytac.exceptions.FieldException = Exception
pytac.exceptions.HandleException = Exception
pytac.__dict__['data_source'] = types.ModuleType('data_source')
pytac.data_source.DataSource = DataSource
try:
pytac.data_source
except AttributeError:
pytac.exceptions.FieldException = Exception
pytac.exceptions.HandleException = Exception
pytac.__dict__['data_source'] = types.ModuleType('data_source')
pytac.data_source.DataSource = types.ClassType('DataSource')

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

sys.modules.update({'at': Mock()})
try:
import at
except ImportError:
sys.modules.update({'at': Mock()})

# -- Project information -----------------------------------------------------

Expand Down

0 comments on commit 1fcb15a

Please sign in to comment.