aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-11-09 20:43:29 -0600
committerGitHub <noreply@github.com>2016-11-09 20:43:29 -0600
commit77c1f6fb553d3dbe7890d15dd1c29c16d400bf61 (patch)
tree7cd7d2fb90afc8ed6e3f48117d6c7abfcb41fd49 /python/servo/testing_commands.py
parent959dfe4a4f3dc2cd284411ba7abbe4947888d3e4 (diff)
parentd9d78bf5d460bddfdb2b5ef98f1d77703e3811f2 (diff)
downloadservo-77c1f6fb553d3dbe7890d15dd1c29c16d400bf61.tar.gz
servo-77c1f6fb553d3dbe7890d15dd1c29c16d400bf61.zip
Auto merge of #14150 - emilio:cleanup-py, r=Ms2ger
python: Cleanup run_tests_or_dispatch to avod rightward drift. <!-- Please describe your changes on the following line: --> r? @aneeshusa (or anyone else really). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14150) <!-- Reviewable:end -->
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r--python/servo/testing_commands.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py
index fdb471a437d..f24750df245 100644
--- a/python/servo/testing_commands.py
+++ b/python/servo/testing_commands.py
@@ -408,19 +408,17 @@ class MachCommands(CommandBase):
def run_test_list_or_dispatch(self, requested_paths, correct_suite, correct_function, **kwargs):
if not requested_paths:
return correct_function(**kwargs)
- else:
- # Paths specified on command line. Ensure they can be handled, re-dispatch otherwise.
- all_handled = True
- for test_path in requested_paths:
- suite = self.suite_for_path(test_path)
- if suite is not None and correct_suite != suite:
- all_handled = False
- print("Warning: %s is not a %s test. Delegating to test-%s." % (test_path, correct_suite, suite))
- if all_handled:
- return correct_function(**kwargs)
- else:
- # Dispatch each test to the correct suite via test()
- Registrar.dispatch("test", context=self.context, params=requested_paths)
+ # Paths specified on command line. Ensure they can be handled, re-dispatch otherwise.
+ all_handled = True
+ for test_path in requested_paths:
+ suite = self.suite_for_path(test_path)
+ if suite is not None and correct_suite != suite:
+ all_handled = False
+ print("Warning: %s is not a %s test. Delegating to test-%s." % (test_path, correct_suite, suite))
+ if all_handled:
+ return correct_function(**kwargs)
+ # Dispatch each test to the correct suite via test()
+ Registrar.dispatch("test", context=self.context, params=requested_paths)
# Helper for test_css and test_wpt:
def wptrunner(self, run_file, **kwargs):