Skip to content

Commit

Permalink
Insert src/ into import search paths when running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zcqian committed Oct 12, 2021
1 parent f8cbc45 commit 0f7ac12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tests/app_tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Chemical and Drug Annotation as a Service.
"""
import os as _os
import sys as _sys
import importlib.util as _imp_util

CONFIG_FILE_NAME = "config_web.py"
Expand Down Expand Up @@ -33,6 +34,9 @@
if not _k.startswith('_'):
globals()[_k] = _v

# insert module import path
_sys.path.insert(0, _os.path.dirname(_cfg_path))

# cleanup
del CONFIG_FILE_NAME

Expand Down

0 comments on commit 0f7ac12

Please sign in to comment.