Use parse_known_args so we can handle extra testrunner named parameters

pull/3916/merge
Patrick Woods 2017-10-12 09:36:55 -04:00 zatwierdzone przez Matt Westcott
rodzic a789ec7b7f
commit fa853de486
2 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -256,6 +256,7 @@ Contributors
* Anselm Bradford
* Mads Jensen
* Samir Shah
* Patrick Woods
Translators
===========

Wyświetl plik

@ -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: