[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Rather than error, keep the default target when none are provided



commit c9dcc48de7222f8e1819fdef4e324ac7d9176839
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Mon Feb 9 08:37:54 2015 -0800

    Rather than error, keep the default target when none are provided
    
    Actually, on reflection if the user only provides attribute targets (ex.
    '--target ONLINE') there's no point in erroring. They clearly want to keep the
    default.
---
 run_tests.py |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/run_tests.py b/run_tests.py
index c696b1d..0d45175 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -385,11 +385,13 @@ def _get_args(argv):
         attribute_targets.remove(Target.RUN_ALL)
         run_targets = all_run_targets
 
-      args['run_targets'] = run_targets
-      args['attribute_targets'] = attribute_targets
+      # if no RUN_* targets are provided then keep the default (otherwise we
+      # won't have any tests to run)
+
+      if run_targets:
+        args['run_targets'] = run_targets
 
-      if not args['run_targets']:
-        raise ValueError("This wouldn't run anything. You need to provide at least one target that starts with 'RUN_'.")
+      args['attribute_targets'] = attribute_targets
     elif opt == '--test':
       args['specific_test'] = arg
     elif opt in ('-l', '--log'):

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits