diff --git a/Makefile b/Makefile index 77fc21de..350d6743 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ depends: .PHONY: lint lint: - $(PYTHON) -m flake8 --ignore E24,E121,E123,E125,E126,E221,E226,E266,E704,E265 --exclude ptvsd/pydevd $(CURDIR) + $(PYTHON) -m tests --lint-only .PHONY: test test: ## Run the test suite. diff --git a/tests/__main__.py b/tests/__main__.py index cd5bc313..e641f80b 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -13,6 +13,7 @@ def convert_argv(argv): help = False quick = False lint = False + runtests = True args = [] modules = set() for arg in argv: @@ -25,6 +26,10 @@ def convert_argv(argv): elif arg == '--lint': lint = True continue + elif arg == '--lint-only': + lint = True + runtests = False + continue # Unittest's main has only flags and positional args. # So we don't worry about options with values. @@ -60,7 +65,7 @@ def convert_argv(argv): '--top-level-directory', PROJECT_ROOT, '--start-directory', start, ] - return cmd + args, lint + return cmd + args, runtests, lint def fix_sys_path(): @@ -88,8 +93,10 @@ def check_lint(): if __name__ == '__main__': - argv, lint = convert_argv(sys.argv[1:]) + argv, runtests, lint = convert_argv(sys.argv[1:]) fix_sys_path() if lint: check_lint() - unittest.main(module=None, argv=argv) + if runtests: + print('running tests...') + unittest.main(module=None, argv=argv)