Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
python: Cleanup run_tests_or_dispatch.
  • Loading branch information
emilio committed Nov 9, 2016
1 parent 333c397 commit d9d78bf
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions python/servo/testing_commands.py
Expand Up @@ -408,19 +408,17 @@ def _test_wpt(self, **kwargs):
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):
Expand Down

0 comments on commit d9d78bf

Please sign in to comment.