def test_multiply_tests_by_their_scenarios(self): loader = TestLoader() suite = loader.suiteClass() test_instance = PretendVaryingTest('test_nothing') multiply_tests_by_their_scenarios(test_instance, suite) self.assertEqual(['a', 'a', 'b', 'b'], get_generated_test_attributes(suite, 'value'))
def test_suite(): from unittest import TestSuite from bzrlib.tests import TestLoader suite = TestSuite() loader = TestLoader() testmod_names = [ 'test_classify'] suite.addTest(loader.loadTestsFromModuleNames(['%s.%s' % (__name__, i) for i in testmod_names])) return suite
def test_multiply_tests_by_their_scenarios(self): loader = TestLoader() suite = loader.suiteClass() test_instance = PretendVaryingTest('test_nothing') multiply_tests_by_their_scenarios( test_instance, suite) self.assertEquals( ['a', 'a', 'b', 'b'], get_generated_test_attributes(suite, 'value'))
def test_multiply_tests(self): loader = TestLoader() suite = loader.suiteClass() multiply_tests( self, vary_by_color(), suite) self.assertEquals( ['blue', 'green', 'red'], get_generated_test_attributes(suite, 'color'))
def test_suite(): module_names = [__name__ + '.' + x for x in [ 'test_commands', 'test_exporter', 'test_branch_mapper', 'test_generic_processor', 'test_revision_store', ]] loader = TestLoader() return loader.loadTestsFromModuleNames(module_names)
def test_suite(): # Thunk across to load_tests for niceness with older bzr versions from bzrlib.tests import TestLoader loader = TestLoader() return loader.loadTestsFromModuleNames(['bzrlib.plugins.search'])
def test_multiply_tests_no_scenarios(self): """Tests with no scenarios attribute aren't multiplied""" suite = TestLoader().suiteClass() multiply_tests_by_their_scenarios(self, suite) self.assertLength(1, list(iter_suite_tests(suite)))
def test_multiply_tests(self): loader = TestLoader() suite = loader.suiteClass() multiply_tests(self, vary_by_color(), suite) self.assertEqual(['blue', 'green', 'red'], get_generated_test_attributes(suite, 'color'))
def test_suite(): loader = TestLoader() return loader.loadTestsFromName(__name__)