summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-12-30 16:31:26 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2016-12-30 17:18:19 -0800
commitc88df5819d2c62abbc3eb5a808ea1cce360ac884 (patch)
treec757c63c280bae64c66ce0f66a59259c24b07939 /lib
parentb5537553f2ec7de70b507936a3abea30b71e2cbf (diff)
downloadspack-c88df5819d2c62abbc3eb5a808ea1cce360ac884.tar.gz
spack-c88df5819d2c62abbc3eb5a808ea1cce360ac884.tar.bz2
spack-c88df5819d2c62abbc3eb5a808ea1cce360ac884.tar.xz
spack-c88df5819d2c62abbc3eb5a808ea1cce360ac884.zip
Fix test command arg handling.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/test.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py
index 2e0ab8b49e..9d92037bb6 100644
--- a/lib/spack/spack/cmd/test.py
+++ b/lib/spack/spack/cmd/test.py
@@ -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
+ # 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.
- return pytest.main(unknown_args + args.tests)
+
+ # Just run the pytest command
+ return pytest.main(unknown_args + args.tests)