We’ve been looking at this a little bit recently. There haven’t “traditionally” been unit tests in Skills but especially when you get to more complex Skills they become very important.
First, to make sure the
mycroft module and all of the goodies that come with Mycroft are available, you want to have the Mycroft venv activated eg:
And depending on what you want to add unit tests for, you might need to restructure your Skill a bit.
The News Skill has some unit tests for it’s
station module which is easy enough with a “normally structured” Mycroft Skill.
But to test your Skills class you would probably need to move that class to it’s own module. I’ve done a quick example on a branch of the HelloWorldSkill here:
Because of the way we load Skills into Mycroft - at present you still need to have the top-level
__init__.py file containing the
Be good to hear how this fits in with your development workflow and whether it meets the needs of your project?