From 738da490db1af496b788eae0a6dda330314fe9c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Thu, 18 Jan 2018 16:10:13 +0100 Subject: [PATCH] Add test to command line --- senpy/__main__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/senpy/__main__.py b/senpy/__main__.py index be5b31d..886675c 100644 --- a/senpy/__main__.py +++ b/senpy/__main__.py @@ -22,6 +22,7 @@ the server. from flask import Flask from senpy.extensions import Senpy +from senpy.utils import easy_test import logging import os @@ -39,7 +40,7 @@ def main(): '-l', metavar='logging_level', type=str, - default="ERROR", + default="WARN", help='Logging level') parser.add_argument( '--debug', @@ -75,6 +76,12 @@ def main(): action='store_true', default=False, help='Do not run a server, only install plugin dependencies') + parser.add_argument( + '--only-test', + '-t', + action='store_true', + default=False, + help='Do not run a server, just test all plugins') parser.add_argument( '--only-list', '--list', @@ -122,6 +129,9 @@ def main(): if args.only_install: return sp.activate_all() + if args.only_test: + easy_test(sp.plugins()) + return print('Senpy version {}'.format(senpy.__version__)) print('Server running on port %s:%d. Ctrl+C to quit' % (args.host, args.port))