diff options
author | Rob Austein <sra@hactrn.net> | 2016-06-10 16:42:48 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-06-10 16:42:48 -0400 |
commit | 5e349fa7c3aa2c60a457b3d799032a6fc62dc43a (patch) | |
tree | 06e3064900cf65dc73dcb09ec44de9f59effcca7 | |
parent | 0a4d6f682f140026242d1b93f8ce816ca79f55ec (diff) |
Add support for running only a specified subset of the unit tests.
-rw-r--r-- | unit_tests.py | 4 |
1 files changed, 3 insertions, 1 deletions
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() |