def test_list_tests(self): class ModuleImportFailure(TestSuite): pass # get out test suite and add in our mock of python's failure module to # make sure list_tests skips it suite = self._get_suite_groupings() suite.addTest(ModuleImportFailure()) tests = list(list_tests(suite)) self.assert_test_strings('aa,ac,bb,bc,cc', tests)
def test_misc(self): # misc stuff to hit our 100% coverage suite = discover_tests(self.start_dir, pattern=self.pattern) for t in list_tests(suite): t.run()
def _check_discover(self, labels, expected): suite = discover_tests(self.start_dir, labels=labels, pattern=self.pattern) tests = list_tests(suite) self.assert_test_strings(expected, tests)