diff options
author | skullydazed <skullydazed@users.noreply.github.com> | 2019-11-20 14:54:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-20 14:54:18 -0800 |
commit | f7bdc54c697ff24bec1bd0781666ac05401bafb2 (patch) | |
tree | 704511c89bd36582fcd0a4a05ae4812222d9b11c /lib/python/qmk/cli/pytest.py | |
parent | d2115f7d1c3a314e997ec6800b6741d83115d6be (diff) | |
download | qmk_firmware-f7bdc54c697ff24bec1bd0781666ac05401bafb2.tar.gz qmk_firmware-f7bdc54c697ff24bec1bd0781666ac05401bafb2.zip |
Add flake8 to our test suite and fix all errors (#7379)
* Add flake8 to our test suite and fix all errors
* Add some documentation
Diffstat (limited to 'lib/python/qmk/cli/pytest.py')
-rw-r--r-- | lib/python/qmk/cli/pytest.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/python/qmk/cli/pytest.py b/lib/python/qmk/cli/pytest.py index 14613e1d9..09611d750 100644 --- a/lib/python/qmk/cli/pytest.py +++ b/lib/python/qmk/cli/pytest.py | |||
@@ -2,19 +2,15 @@ | |||
2 | 2 | ||
3 | QMK script to run unit and integration tests against our python code. | 3 | QMK script to run unit and integration tests against our python code. |
4 | """ | 4 | """ |
5 | import sys | 5 | import subprocess |
6 | |||
6 | from milc import cli | 7 | from milc import cli |
7 | 8 | ||
8 | 9 | ||
9 | @cli.subcommand('QMK Python Unit Tests') | 10 | @cli.subcommand('QMK Python Unit Tests') |
10 | def pytest(cli): | 11 | def pytest(cli): |
11 | """Use nose2 to run unittests | 12 | """Run several linting/testing commands. |
12 | """ | 13 | """ |
13 | try: | 14 | flake8 = subprocess.run(['flake8', 'lib/python', 'bin/qmk']) |
14 | import nose2 | 15 | nose2 = subprocess.run(['nose2', '-v']) |
15 | 16 | return flake8.returncode | nose2.returncode | |
16 | except ImportError: | ||
17 | cli.log.error('Could not import nose2! Please install it with {fg_cyan}pip3 install nose2') | ||
18 | return False | ||
19 | |||
20 | nose2.discover(argv=['nose2', '-v']) | ||