Files
zsa_qmk_firmware/lib/python/qmk/cli/pytest.py
T

21 lines
452 B
Python
Raw Normal View History

2019-08-21 23:40:24 -07:00
"""QMK Python Unit Tests
QMK script to run unit and integration tests against our python code.
"""
2019-09-22 13:25:33 -07:00
import sys
2019-08-21 23:40:24 -07:00
from milc import cli
2019-09-22 13:25:33 -07:00
@cli.subcommand('QMK Python Unit Tests')
def pytest(cli):
2019-08-21 23:40:24 -07:00
"""Use nose2 to run unittests
"""
try:
import nose2
2019-09-22 13:25:33 -07:00
2019-08-21 23:40:24 -07:00
except ImportError:
cli.log.error('Could not import nose2! Please install it with {fg_cyan}pip3 install nose2')
return False
2019-09-22 13:25:33 -07:00
nose2.discover(argv=['nose2', '-v'])