From 5e349fa7c3aa2c60a457b3d799032a6fc62dc43a Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 10 Jun 2016 16:42:48 -0400 Subject: Add support for running only a specified subset of the unit tests. --- unit_tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unit_tests.py b/unit_tests.py index 923d108..4d09b6a 100644 --- a/unit_tests.py +++ b/unit_tests.py @@ -14,7 +14,8 @@ def main(): from sys import argv global args args = parse_arguments(argv[1:]) - unittest.main(verbosity = 1 if args.quiet else 2, argv = argv[:1], catchbreak = True) + argv = argv[:1] + args.only_test + unittest.main(verbosity = 1 if args.quiet else 2, argv = argv, catchbreak = True) def parse_arguments(argv = ()): from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter @@ -33,6 +34,7 @@ def parse_arguments(argv = ()): parser.add_argument("--sql-file", default = "unit_tests.db", help = "SQLite3 database") parser.add_argument("--ks-client", default = "unit_tests.ks-client", help = "client keystore (ks_mmap only)") parser.add_argument("--ks-server", default = "unit_tests.ks-server", help = "server keystore (ks_mmap only)") + parser.add_argument("--only-test", default = [], nargs = "+", help = "only run tests named here") return parser.parse_args(argv) args = parse_arguments() -- cgit v1.2.3