def testLoadAllTestsInModule(self): tests = serially_executed_browser_test_case.LoadAllTestsInModule( sys.modules[__name__]) self.assertEquals(sorted([t.id() for t in tests]), ['telemetry.testing.browser_test_runner_unittest.Algebra.TestNumber', 'telemetry.testing.browser_test_runner_unittest.Algebra.testOne', 'telemetry.testing.browser_test_runner_unittest.Algebra.testTwo', 'telemetry.testing.browser_test_runner_unittest.Geometric.TestAngle', 'telemetry.testing.browser_test_runner_unittest.Geometric.testBasic'])
def testLoadAllTestsInModule(self): context = browser_test_context.TypTestContext() context.finder_options = options_for_unittests.GetCopy() context.test_class = Algebra context.test_case_ids_to_run.add( 'telemetry.testing.browser_test_runner_unittest.Algebra.TestNumber') context.test_case_ids_to_run.add( 'telemetry.testing.browser_test_runner_unittest.Algebra.testOne') context.Freeze() browser_test_context._global_test_context = context try: # This should not invoke GenerateTestCases of ErrorneousGeometric class, # otherwise that would throw Exception. tests = serially_executed_browser_test_case.LoadAllTestsInModule( sys.modules[__name__]) self.assertEquals(sorted([t.id() for t in tests]), ['telemetry.testing.browser_test_runner_unittest.Algebra.TestNumber', 'telemetry.testing.browser_test_runner_unittest.Algebra.testOne']) finally: browser_test_context._global_test_context = None
def load_tests(loader, tests, pattern): del loader, tests, pattern # Unused. return serially_executed_browser_test_case.LoadAllTestsInModule( sys.modules[__name__])
def load_tests(loader, tests, pattern): # pylint: disable=invalid-name del loader, tests, pattern # Unused. return serially_executed_browser_test_case.LoadAllTestsInModule( sys.modules[__name__])
def LoadAllTestsInModule(module): # Just delegates to serially_executed_browser_test_case to reduce the # number of imports in other files. return serially_executed_browser_test_case.LoadAllTestsInModule(module)
def load_tests(*_): return serially_executed_browser_test_case.LoadAllTestsInModule( sys.modules[__name__])