summaryrefslogtreecommitdiff
path: root/runtests.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2013-08-09 03:47:58 +0300
committerAndrew Svetlov <andrew.svetlov@gmail.com>2013-08-09 03:47:58 +0300
commit4738b8f1e74c7927e58e9e2e2938d6a3cb40c212 (patch)
treeed5dbb27793cbdf98df746ac721a79bf9530900a /runtests.py
parent457ab85f756c50cda06adb9c99a1b8b466d14ccd (diff)
downloadtrollius-4738b8f1e74c7927e58e9e2e2938d6a3cb40c212.tar.gz
Add --failfast parameter to runtests.py
Diffstat (limited to 'runtests.py')
-rw-r--r--runtests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtests.py b/runtests.py
index cd33442..e254fdc 100644
--- a/runtests.py
+++ b/runtests.py
@@ -40,6 +40,9 @@ ARGS.add_argument(
ARGS.add_argument(
'-x', action="store_true", dest='exclude', help='exclude tests')
ARGS.add_argument(
+ '-f', '--failfast', action="store_true", default=False,
+ dest='failfast', help='Stop on first fail or error')
+ARGS.add_argument(
'-q', action="store_true", dest='quiet', help='quiet')
ARGS.add_argument(
'--tests', action="store", dest='testsdir', default='tests',
@@ -138,6 +141,7 @@ def runtests():
includes = args.pattern
v = 0 if args.quiet else args.verbose + 1
+ failfast = args.failfast
tests = load_tests(args.testsdir, includes, excludes)
logger = logging.getLogger()
@@ -151,7 +155,7 @@ def runtests():
logger.setLevel(logging.INFO)
elif v >= 4:
logger.setLevel(logging.DEBUG)
- result = unittest.TextTestRunner(verbosity=v).run(tests)
+ result = unittest.TextTestRunner(verbosity=v, failfast=failfast).run(tests)
sys.exit(not result.wasSuccessful())