Fix test command arg handling.

This commit is contained in:
Todd Gamblin 2016-12-30 16:31:26 -08:00
parent b5537553f2
commit c88df5819d

View File

@ -99,9 +99,10 @@ def test(parser, args, unknown_args):
do_list(args, unknown_args)
return
if args.tests and not any(arg.startswith('-') for arg in args.tests):
# Allow keyword search without -k if no options are specified
if (args.tests and not unknown_args and
not any(arg.startswith('-') for arg in args.tests)):
return pytest.main(['-k'] + args.tests)
else:
# Just run the pytest command.
# Just run the pytest command
return pytest.main(unknown_args + args.tests)