Add support for SKILL_DIR variable to execute just one skill test
@@ -16,7 +16,7 @@ import pytest
import glob
import os
-from os.path import exists, join, expanduser
+from os.path import exists, join, expanduser, abspath
import imp
from mycroft.configuration import Configuration
@@ -76,12 +76,14 @@ skills_dir = get_skills_dir()
tests = discover_tests(skills_dir)
loader = MockSkillsLoader(skills_dir)
emitter = loader.load_skills()
+skill_dir = os.environ.get('SKILL_DIR', '')
class TestCase(object):
@pytest.mark.parametrize("skill,test", sum([
[(skill, test) for test in tests[skill]]
for skill in tests.keys()
+ if not skill_dir or abspath(skill).startswith(abspath(skill_dir))
], []))
def test_skill(self, skill, test):
example, test_env = test
