summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli/pytest.py
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2019-11-20 14:54:18 -0800
committerFlorian Didron <fdidron@users.noreply.github.com>2020-01-09 08:57:11 +0900
commitdfa3631a44eee30c7c734cf023ef1316e240eca3 (patch)
tree0b7f603490af486c24f58512a109c19355d1eb40 /lib/python/qmk/cli/pytest.py
parent4dc4b7af75e4757f13ae8f16ed760452ea4f1af0 (diff)
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.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/python/qmk/cli/pytest.py b/lib/python/qmk/cli/pytest.py
index 14613e1d96..09611d750f 100644
--- a/lib/python/qmk/cli/pytest.py
+++ b/lib/python/qmk/cli/pytest.py
@@ -2,19 +2,15 @@
QMK script to run unit and integration tests against our python code.
"""
-import sys
+import subprocess
+
from milc import cli
@cli.subcommand('QMK Python Unit Tests')
def pytest(cli):
- """Use nose2 to run unittests
+ """Run several linting/testing commands.
"""
- try:
- import nose2
-
- except ImportError:
- cli.log.error('Could not import nose2! Please install it with {fg_cyan}pip3 install nose2')
- return False
-
- nose2.discover(argv=['nose2', '-v'])
+ flake8 = subprocess.run(['flake8', 'lib/python', 'bin/qmk'])
+ nose2 = subprocess.run(['nose2', '-v'])
+ return flake8.returncode | nose2.returncode