From e4cd66be5cf75a6969bb9e039edad51f7e472bd4 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Sun, 5 Feb 2017 16:21:07 -0800 Subject: [PATCH] Add root to python paths --- tests/test_package.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_package.py b/tests/test_package.py index 6b5eb4f8c..8907a2823 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -1,13 +1,23 @@ """import tests.""" import os +import sys import importlib import pytest + +script_dir = os.path.dirname(os.path.abspath(__file__)) +# Add root to python paths, this allows us to import submodules +sys.path.append(os.path.realpath(os.path.join(script_dir, '..'))) + +# noinspection PyPep8 import service +# noinspection PyPep8 import gui +# noinspection PyPep8 import eos +# noinspection PyPep8 import utils @@ -39,9 +49,6 @@ def eos_modules(): ) yield mod_name -# Disable test -''' @pytest.mark.parametrize("mod_name", eos_modules()) def test_eos_imports(mod_name): assert importlib.import_module(mod_name) -'''