Chromium Code Reviews| Index: telemetry/telemetry/testing/serially_executed_browser_test_case.py |
| diff --git a/telemetry/telemetry/testing/serially_executed_browser_test_case.py b/telemetry/telemetry/testing/serially_executed_browser_test_case.py |
| index db421d0059dd8caadcdc42101620531a3ab9a6e9..fecadfaebd10072fa151eafccd4df7ed16ba3f27 100644 |
| --- a/telemetry/telemetry/testing/serially_executed_browser_test_case.py |
| +++ b/telemetry/telemetry/testing/serially_executed_browser_test_case.py |
| @@ -8,7 +8,7 @@ import unittest |
| from py_utils import cloud_storage |
| from telemetry.internal.browser import browser_finder |
| -from telemetry.testing import options_for_unittests |
| +from telemetry.testing import browser_test_context |
| from telemetry.util import wpr_modes |
| @@ -31,7 +31,7 @@ class SeriallyExecutedBrowserTestCase(unittest.TestCase): |
| @classmethod |
| def setUpClass(cls): |
| - cls._finder_options = options_for_unittests.GetCopy() |
| + cls._finder_options = browser_test_context.GetCopy().finder_options |
| cls.platform = None |
| cls.browser = None |
| cls._browser_to_create = None |
| @@ -142,12 +142,21 @@ def LoadAllTestsInModule(module): |
| test cases to be run. |
| """ |
| suite = unittest.TestSuite() |
| + test_context = browser_test_context.GetCopy() |
| for _, obj in inspect.getmembers(module): |
| if (inspect.isclass(obj) and |
| issubclass(obj, SeriallyExecutedBrowserTestCase)): |
| + # We bail out early if the test class's name doesn't match with targeted |
|
Ken Russell (switch to Gerrit)
2016/12/21 00:12:59
match with -> match the
nednguyen
2016/12/21 20:29:04
Done.
|
| + # test_class_name in test_context. This is to avoid possible errors in |
| + # GenerateTestCases below as the test class may define custom options |
| + # in finder_options object, and hence may throw exception if they can't |
| + # find their customed options in finder_options object. |
|
Ken Russell (switch to Gerrit)
2016/12/21 00:12:59
customed -> custom
Also, if the basic idea here i
nednguyen
2016/12/21 20:29:04
Done.
|
| + if test_context.test_class_name != obj.Name(): |
| + continue |
| for test in GenerateTestCases( |
| - test_class=obj, finder_options=options_for_unittests.GetCopy()): |
| - suite.addTest(test) |
| + test_class=obj, finder_options=test_context.finder_options): |
| + if test.id() in test_context.test_cases_ids_to_run: |
| + suite.addTest(test) |
| return suite |