From fa853de486c6542434e27b045ed921052b734eb5 Mon Sep 17 00:00:00 2001 From: Patrick Woods Date: Thu, 12 Oct 2017 09:36:55 -0400 Subject: [PATCH] Use parse_known_args so we can handle extra testrunner named parameters --- CONTRIBUTORS.rst | 1 + runtests.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index ed17ab04b2..77e19c3f91 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -256,6 +256,7 @@ Contributors * Anselm Bradford * Mads Jensen * Samir Shah +* Patrick Woods Translators =========== diff --git a/runtests.py b/runtests.py index ec942acfd5..629ca118a0 100755 --- a/runtests.py +++ b/runtests.py @@ -20,16 +20,15 @@ def make_parser(): parser.add_argument('--elasticsearch', action='store_true') parser.add_argument('--elasticsearch2', action='store_true') parser.add_argument('--elasticsearch5', action='store_true') - parser.add_argument('rest', nargs='*') return parser def parse_args(args=None): - return make_parser().parse_args(args) + return make_parser().parse_known_args(args) def runtests(): - args = parse_args() + args, rest = parse_args() only_wagtail = r'^wagtail(\.|$)' if args.deprecation == 'all': @@ -66,7 +65,7 @@ def runtests(): # forcibly delete the ELASTICSEARCH_URL setting to skip those tests del os.environ['ELASTICSEARCH_URL'] - argv = [sys.argv[0], 'test'] + args.rest + argv = [sys.argv[0], 'test'] + rest try: execute_from_command_line(argv) finally: