2019-08-22 06:40:24 +00:00
|
|
|
"""QMK Python Unit Tests
|
|
|
|
|
|
|
|
QMK script to run unit and integration tests against our python code.
|
|
|
|
"""
|
2021-05-19 22:24:46 +00:00
|
|
|
from subprocess import DEVNULL
|
2019-11-20 22:54:18 +00:00
|
|
|
|
2019-08-22 06:40:24 +00:00
|
|
|
from milc import cli
|
|
|
|
|
|
|
|
|
2019-11-27 20:27:06 +00:00
|
|
|
@cli.subcommand('QMK Python Unit Tests', hidden=False if cli.config.user.developer else True)
|
2019-09-22 20:25:33 +00:00
|
|
|
def pytest(cli):
|
2019-11-20 22:54:18 +00:00
|
|
|
"""Run several linting/testing commands.
|
2019-08-22 06:40:24 +00:00
|
|
|
"""
|
2021-05-19 22:24:46 +00:00
|
|
|
nose2 = cli.run(['nose2', '-v'], capture_output=False, stdin=DEVNULL)
|
2021-08-29 23:50:22 +00:00
|
|
|
flake8 = cli.run(['flake8', 'lib/python'], capture_output=False, stdin=DEVNULL)
|
2021-05-10 18:18:44 +00:00
|
|
|
|
2019-11-20 22:54:18 +00:00
|
|
|
return flake8.returncode | nose2.returncode
|